HackerPapers

arXiv:1012.1802cs.PL

Equality Saturation: A New Approach to Optimization

Ross Tate, Michael Stepp, Zachary Tatlock, Sorin Lerner

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.

arXiv comments
80 pages, 39 figures
Journal reference
Logical Methods in Computer Science, Volume 7, Issue 1 (March 28, 2011) lmcs:1016
DOI
doi:10.2168/LMCS-7(1:10)2011
Subjects
cs.PLProgramming Languages

On Hacker News

Linked by 2 identifiable commenters in 2 comments across 2 threads, from May 2025 to Mar 2026.

Comments linking this paper, per year.

Discussed in comments2 threads

    • From https://arxiv.org/abs/1012.1802 we read the following about "equality saturation" which was a new term to me: > ... 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…

      slwvxView on HNParent context

    • One can have obvious but repetitive optimizations with symbolic programming [1]. [1] https://arxiv.org/abs/1012.1802 Strange that AlphaEvolve authors do not compare their work to what is achievable by equality saturation. An implementation of equality saturation can take…

      theszView on HNParent context

Submitted to Hacker News

Connected through shared HN threads, not inferred similarity or a recommendation.