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

Generating compiler optimizations from proofs

Published: 17 January 2010 Publication 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.
[2]
S. Bansal and A. Aiken. Automatic generation of peephole superoptimizers. In ASPLOS, 2006.
[3]
R. Bergmann. Explanation-based learning for the automated reuse of programs. In CompEuro, 1992.
[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.
[5]
A. Deutsch. Author of {6}. Personal communication, July 2009.
[6]
A. Deutsch, A. Nash, and J. Remmel. The chase revisited. In PODS, 2008.
[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.
[8]
T. Ellman. Generalizing logic circuit designs by analyzing proofs of correctness. In IJCAI, volume 1, pages 643--646, 1985.
[9]
T. Ellman. Explanation-based learning: a survey of programs and perspectives. ACM Computing Surveys, 21(2):163--221, June 1989.
[10]
M. Gandhe and G. Venkatesh. Improving prolog performance by inductive proof generalizations. In Knowledge Based Computer Systems, 1990.
[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.
[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.
[13]
R. Joshi, G. Nelson, and K. Randall. Denali: a goal-directed superoptimizer. In PLDI, June 2002.
[14]
S. Kundu, Z. Tatlock, and S. Lerner. Proving optimizations correct using parameterized program equivalence. In PLDI, 2009.
[15]
S. Lerner, T. Millstein, E. Rice, and C. Chambers. Automated soundness proofs for dataflow analyses and transformations via local rules. In POPL, 2005.
[16]
H. Massalin. Superoptimizer: a look at the smallest program. In ASPLOS, 1987.
[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.
[18]
R. Millner. A theory of type polymorphism in programming. Journal of Computer and System Sciences, 1978.
[19]
M. Stephenson and S. Amarasinghe. Predicting unroll factors using supervised classification. In CGO, Mar. 2005.
[20]
M. Stephenson, S. Amarasinghe, M. Martin, and U.-M. O'Reilly. Meta optimization: Improving compiler heuristics with machine learning. In PLDI, June 2003.
[21]
R. Tate, M. Stepp, and S. Lerner. Generating compiler optimizations from proofs. Technical report, University of California, San Diego, Nov. 2009.
[22]
R. Tate, M. Stepp, Z. Tatlock, and S. Lerner. Equality saturation: a new approach to optimization. In POPL, Jan. 2009.
[23]
S.W.K. Tjiang and J.L. Hennessy. Sharlit -- A tool for building optimizers. In PLDI, 1992.
[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.

Cited By

View all

Index Terms

  1. Generating compiler optimizations from proofs

    Recommendations

    Comments

    Information & Contributors

    Information

    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
    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]

    Sponsors

    In-Cooperation

    Publisher

    Association for Computing Machinery

    New York, NY, United States

    Publication History

    Published: 17 January 2010

    Permissions

    Request permissions for this article.

    Check for updates

    Author Tags

    1. compiler optimization
    2. explanation-based learning
    3. proof generalization

    Qualifiers

    • Research-article

    Conference

    POPL '10
    Sponsor:

    Acceptance Rates

    Overall Acceptance Rate 824 of 4,130 submissions, 20%

    Upcoming Conference

    POPL '25

    Contributors

    Other Metrics

    Bibliometrics & Citations

    Bibliometrics

    Article Metrics

    • Downloads (Last 12 months)34
    • Downloads (Last 6 weeks)9
    Reflects downloads up to 23 Dec 2024

    Other Metrics

    Citations

    Cited By

    View all

    View Options

    Login options

    View options

    PDF

    View or Download as a PDF file.

    PDF

    eReader

    View online with eReader.

    eReader

    Media

    Figures

    Other

    Tables

    Share

    Share

    Share this Publication link

    Share on social media