arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1012.1802cs.PL
收藏

等式饱和:一种新的优化方法

Equality Saturation: A New Approach to Optimization

Ross Tate, Michael Stepp, Zachary Tatlock, Sorin Lerner

摘要:

传统编译器中的优化是顺序应用的,每个优化都破坏性地修改程序以产生转换后的程序,然后将其传递到下一个优化。我们提出了一种新的方法来构造编译器的优化阶段。在我们的方法中,优化采用相等分析的形式,将相等信息添加到公共中间表示中。优化器通过重复应用这些分析来推断程序片段之间的等价性,从而使中间表示充满等式。一旦饱和,中间表示编码输入程序的多个优化版本。在这一点上,盈利性启发式从饱和表示中表示的各种程序中挑选最终优化的程序。我们提出的结构优化器的方法比以前的方法有各种好处:我们的方法避免了需要担心优化排序,使使用一个全局优化启发式,选择完全优化的程序,并可用于执行翻译验证,即使在编译器比我们自己的。我们提出了我们的方法,形式化,并描述了我们选择的中间表示。我们还提出了实验结果表明,我们的方法是实用的时间和空间开销方面,是有效的发现复杂的优化机会,并有效地执行翻译验证一个现实的优化。

英文摘要:

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.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑