skip to main content
10.1145/1706299.1706345acmconferencesArticle/Chapter ViewAbstractPublication PagespoplConference Proceedingsconference-collections
research-article

Generating compiler optimizations from proofs

Published:17 January 2010Publication History

ABSTRACT

We present an automated technique for generating compiler optimizations from examples of concrete programs before and after improvements have been made to them. The key technical insight of our technique is that a proof of equivalence between the original and transformed concrete programs informs us which aspects of the programs are important and which can be discarded. Our technique therefore uses these proofs, which can be produced by translation validation or a proof-carrying compiler, as a guide to generalize the original and transformed programs into broadly applicable optimization rules.

We present a category-theoretic formalization of our proof generalization technique. This abstraction makes our technique applicable to logics besides our own. In particular, we demonstrate how our technique can also be used to learn query optimizations for relational databases or to aid programmers in debugging type errors.

Finally, we show experimentally that our technique enables programmers to train a compiler with application-specific optimizations by providing concrete examples of original programs and the desired transformed programs. We also show how it enables a compiler to learn efficient-to-run optimizations from expensive-to-run super-optimizers.

References

  1. J. Adámek, H. Herrlich, and G.E. Strecker. Abstract and Concrete Categories: The Joy of Cats. John Wiley & Sons, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  2. S. Bansal and A. Aiken. Automatic generation of peephole superoptimizers. In ASPLOS, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. R. Bergmann. Explanation-based learning for the automated reuse of programs. In CompEuro, 1992.Google ScholarGoogle ScholarCross RefCross Ref
  4. K.D. Cooper, D. Subramanian, and L. Torczon. Adaptive optimizing compilers for the 21st century. The Journal of Supercomputing, 23(1):7--22, Aug. 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  5. A. Deutsch. Author of {6}. Personal communication, July 2009.Google ScholarGoogle Scholar
  6. A. Deutsch, A. Nash, and J. Remmel. The chase revisited. In PODS, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. S. Dietzen and F. Pfenning. Higher-order and modal logic as a framework for explanation-based generalization. Machine Learning, 9(1):23--55, June 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. T. Ellman. Generalizing logic circuit designs by analyzing proofs of correctness. In IJCAI, volume 1, pages 643--646, 1985. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. T. Ellman. Explanation-based learning: a survey of programs and perspectives. ACM Computing Surveys, 21(2):163--221, June 1989. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. M. Gandhe and G. Venkatesh. Improving prolog performance by inductive proof generalizations. In Knowledge Based Computer Systems, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. S.Z. Guyer and C. Lin. Broadway: A compiler for exploiting the domain-specific semantics of software libraries. Proceedings of IEEE, 93(2), 2005.Google ScholarGoogle ScholarCross RefCross Ref
  12. C. Haack and J.B. Wells. Type error slicing in implicitly typed higher-order languages. Science of Computer Programming, 50(1-3):189--224, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. R. Joshi, G. Nelson, and K. Randall. Denali: a goal-directed superoptimizer. In PLDI, June 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. S. Kundu, Z. Tatlock, and S. Lerner. Proving optimizations correct using parameterized program equivalence. In PLDI, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. S. Lerner, T. Millstein, E. Rice, and C. Chambers. Automated soundness proofs for dataflow analyses and transformations via local rules. In POPL, 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. H. Massalin. Superoptimizer: a look at the smallest program. In ASPLOS, 1987. Google ScholarGoogle ScholarCross RefCross Ref
  17. A. McGovern, J.E.B. Moss, and A.G. Barto. Building a basic block instruction scheduler with reinforcement learning and rollouts. Machine Learning, Special Issue on Reinforcement Learning, 49(2/3):141--160, May 2002. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. R. Millner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 1978.Google ScholarGoogle ScholarCross RefCross Ref
  19. M. Stephenson and S. Amarasinghe. Predicting unroll factors using supervised classification. In CGO, Mar. 2005. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. M. Stephenson, S. Amarasinghe, M. Martin, and U.-M. O'Reilly. Meta optimization: Improving compiler heuristics with machine learning. In PLDI, June 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  21. R. Tate, M. Stepp, and S. Lerner. Generating compiler optimizations from proofs. Technical report, University of California, San Diego, Nov. 2009.Google ScholarGoogle Scholar
  22. R. Tate, M. Stepp, Z. Tatlock, and S. Lerner. Equality saturation: a new approach to optimization. In POPL, Jan. 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library
  23. S.W.K. Tjiang and J.L. Hennessy. Sharlit -- A tool for building optimizers. In PLDI, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  24. D.L. Whitfield and M.L. Soffa. An approach for exploring code improving transformations. ACM Transactions on Programming Languages and Systems, 19(6):1053--1084, Nov. 1997. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Generating compiler optimizations from proofs

    Recommendations

    Comments

    Login options

    Check if you have access through your login credentials or your institution to get full access on this article.

    Sign in
    • Published in

      cover image ACM Conferences
      POPL '10: Proceedings of the 37th annual ACM SIGPLAN-SIGACT symposium on Principles of programming languages
      January 2010
      520 pages
      ISBN:9781605584799
      DOI:10.1145/1706299
      • cover image ACM SIGPLAN Notices
        ACM SIGPLAN Notices  Volume 45, Issue 1
        POPL '10
        January 2010
        500 pages
        ISSN:0362-1340
        EISSN:1558-1160
        DOI:10.1145/1707801
        Issue’s Table of Contents

      Copyright © 2010 ACM

      Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

      Publisher

      Association for Computing Machinery

      New York, NY, United States

      Publication History

      • Published: 17 January 2010

      Permissions

      Request permissions about this article.

      Request Permissions

      Check for updates

      Qualifiers

      • research-article

      Acceptance Rates

      Overall Acceptance Rate824of4,130submissions,20%

      Upcoming Conference

      POPL '25

    PDF Format

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader