Affiliation:
1. University of Califorina, San Diego, San Diego, CA, USA
Abstract
Optimizations in a traditional compiler are applied sequentially, with each optimization destructively modifying the program to produce a transformed program that is then passed to the next optimization. We present a new approach for structuring the optimization phase of a compiler. In our approach, optimizations take the form of equality analyses that add equality information to a common intermediate representation. The optimizer works by repeatedly applying these analyses to infer equivalences between program fragments, thus saturating the intermediate representation with equalities. Once saturated, the intermediate representation encodes multiple optimized versions of the input program. At this point, a profitability heuristic picks the final optimized program from the various programs represented in the saturated representation. Our proposed way of structuring optimizers has a variety of benefits over previous approaches: our approach obviates the need to worry about optimization ordering, enables the use of a global optimization heuristic that selects among fully optimized programs, and can be used to perform translation validation, even on compilers other than our own. We present our approach, formalize it, and describe our choice of intermediate representation. We also present experimental results showing that our approach is practical in terms of time and space overhead, is effective at discovering intricate optimization opportunities, and is effective at performing translation validation for a realistic optimizer.
Publisher
Association for Computing Machinery (ACM)
Subject
Computer Graphics and Computer-Aided Design,Software
Cited by
94 articles.
订阅此论文施引文献
订阅此论文施引文献,注册后可以免费订阅5篇论文的施引文献,订阅后可以查看论文全部施引文献
1. SpEQ: Translation of Sparse Codes using Equivalences;Proceedings of the ACM on Programming Languages;2024-06-20
2. Hydra: Generalizing Peephole Optimizations with Program Synthesis;Proceedings of the ACM on Programming Languages;2024-04-29
3. Evaluating the Effectiveness of Deep Learning Models for Foundational Program Analysis Tasks;Proceedings of the ACM on Programming Languages;2024-04-29
4. Automatic Generation of Vectorizing Compilers for Customizable Digital Signal Processors;Proceedings of the 29th ACM International Conference on Architectural Support for Programming Languages and Operating Systems, Volume 1;2024-04-17
5. Wasm-Mutate: Fast and effective binary diversification for WebAssembly;Computers & Security;2024-04