Skip to main content

Guaranteed Optimization: Proving Nullspace Properties of Compilers

  • Conference paper
  • First Online:
Static Analysis (SAS 2002)

Part of the book series: Lecture Notes in Computer Science ((LNCS,volume 2477))

Included in the following conference series:

Abstract

Writing performance-critical programs can be frustrating because optimizing compilers for imperative languages tend to be unpredictable. For a subset of optimizations - those that simplify rather than reorder code - it would be useful to prove that a compiler reliably performs optimizations. We show that adopting a “superanalysis” approach to optimization enables such a proof. By analogy with linear algebra, we define the nullspace of an optimizer as those programs it reduces to the empty program. To span the nullspace, we define rewrite rules that de-optimize programs by introducing abstraction. For a model compiler we prove that any sequence of de-optimizing rewrite rule applications is undone by the optimizer. Thus, we are able to give programmers a clear mental model of what simplifications the compiler is guaranteed to perform, and make progress on the problem of “abstraction penalty” in imperative languages.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 39.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 54.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Cliff Click and Keith D. Cooper. Combining analyses, combining optimizations. ACM Transactions on Programming Languages and Systems, 17(2):181–196, March 1995.

    Google Scholar 

  2. Patrick Cousot and Radhia Cousot. Abstract interpretation: A unified lattice model for static analysis of programs by construction or approximation of fixpoints. In Proc. Principles of Programming Languages, pages 238–252, January 1977.

    Google Scholar 

  3. Patrick Cousot and Radhia Cousot. Automatic synthesis of optimal invariant assertions: Mathematical foundations. In Proceedings of the 1977 symposium on Artificial intelligence and programming languages, pages 1–12, 1977.

    Google Scholar 

  4. Nachum Dershowitz. A taste of rewrite systems. In Proc. Functional Programming, Concurrency, Simulation and Automated Reasoning, volume 693 of Lecture Notes in Computer Science, pages 199–228, 1993.

    Google Scholar 

  5. Nachum Dershowitz and Jean-Pierre Jouannaud. Rewrite systems. In Handbook of Theoretical Computer Science, Volume B: Formal Models and Sematics (B), pages 243–320. 1990.

    Google Scholar 

  6. A. J. Gill and S. L. Peyton Jones. Cheap deforestation in practice: An optimiser for Haskell. In Bjørn Pehrson and Imre Simon, editors, Proceedings of the IFIP 13th World Computer Congress. Volume 1: Technology and Foundations, pages 581–586, Amsterdam, The Netherlands, August 28–September 1 1994. Elsevier Science Publishers.

    Google Scholar 

  7. Gary A. Kildall. A unified approach to global program optimization. In Conference Record of the ACM Symposium on Principles of Programming Languages, pages 194–206. ACM SIGACT and SIGPLAN, ACM Press, 1973.

    Google Scholar 

  8. Sorin Lerner, David Grove, and Craig Chambers. Composing dataflow analyses and transformations. A CM SIGPLAN Notices, 31(1):270–282, January 2002.

    Google Scholar 

  9. Steven S. Muchnick. Advanced Compiler Design and Implementation. Morgan Kaufmann, San Francisco, 2000.

    Google Scholar 

  10. Matthias Müller. Abstraction benchmarks and performance of C++ applications. In Proceedings of the Fourth International Conference on Supercomputing in Nuclear Applications, 2000.

    Google Scholar 

  11. Arch D. Robison. The abstraction penalty for small objects in C++. In POOMA’96: The Parallel Object-Oriented Methods and Applications Conference, Feb. 28–Mar. 1 1996. Santa Fe, New Mexico.

    Google Scholar 

  12. Amr Sabry and Matthias Felleisen. Reasoning about programs in continuation-passing style. LISP and Symbolic Computation, 6(3–4):289–360, 1993.

    Article  Google Scholar 

  13. David Sands. Total correctness by local improvement in the transformation of functional programs. ACM Transactions on Programming Languages and Systems, 18(2):175–234, March 1996.

    Google Scholar 

  14. Jeremy G. Siek and Andrew Lumsdaine. The matrix template library: A unifying framework for numerical linear algebra. In Parallel Object Oriented Scientific Computing. ECOOP, 1998.

    Google Scholar 

  15. Alex Stepanov. Abstraction penalty benchmark, 1994.

    Google Scholar 

  16. Walid Taha and Tim Sheard. Multi-stage programming with explicit annotations. ACM SIGPLAN Notices, 32(12):203–217, 1997.

    Article  Google Scholar 

  17. Todd L. Veldhuizen. Arrays in Blitz++. In Computing in Object-Oriented Parallel Environments: Second International Symposium (ISCOPE 98), volume 1505 of Lecture Notes in Computer Science, pages 223–230. Springer-Verlag, 1998.

    Chapter  Google Scholar 

  18. Todd L. Veldhuizen and Andrew Lumsdaine. Guaranteed optimization: Proving nullspace properties of compilers. Technical Report TR564, Indiana University Computer Science, 2002.

    Google Scholar 

  19. Eelco Visser. A survey of rewriting strategies in program transformation systems. In B. Gramlich and S. Lucas, editors, Workshop on Reduction Strategies in Rewriting and Programming (WRS’01), volume 57 of Electronic Notes in Theoretical Computer Science, Utrecht, The Netherlands, May 2001. Elsevier Science Publishers.

    Google Scholar 

  20. Eelco Visser, Zine-el-Abidine Benaissa, and Andrew Tolmach. Building program optimizers with rewriting strategies. ACM SIGPLAN Notices, 34(1):13–26, January 1999. Proceedings of the International Conference on Functional Programming (ICFP’98).

    Google Scholar 

  21. P. Wadler. Deforestation: transforming programs to eliminate trees. Theoretical Computer Science, 73(2):231–248, June 1990.

    Google Scholar 

  22. Mark N. Wegman and Kenneth Zadeck. Constant propagation with conditional branches. ACM Transactions on Programming Languages and Systems, 13(2):181–210, April 1991.

    Google Scholar 

  23. Jiawang Wei. Correctness of fixpoint transformations. Theoretical Computer Science, 129(1):123–142, June 1994.

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2002 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Veldhuizen, T.L., Lumsdaine, A. (2002). Guaranteed Optimization: Proving Nullspace Properties of Compilers. In: Hermenegildo, M.V., Puebla, G. (eds) Static Analysis. SAS 2002. Lecture Notes in Computer Science, vol 2477. Springer, Berlin, Heidelberg. https://doi.org/10.1007/3-540-45789-5_20

Download citation

  • DOI: https://doi.org/10.1007/3-540-45789-5_20

  • Published:

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-44235-6

  • Online ISBN: 978-3-540-45789-3

  • eBook Packages: Springer Book Archive

Publish with us

Policies and ethics