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

LLVM中窥视孔优化的前提条件推断

Precondition Inference for Peephole Optimizations in LLVM

David Menendez, Santosh Nagarakatte

摘要:

窥视孔优化是编译器错误的常见来源。编译器开发人员通常通过加强前提条件将不正确的窥视孔优化转换为有效的窥视孔优化。这一过程既具有挑战性又繁琐。本文提出了ALIVE-INFER,一种数据驱动的方法,推断的先决条件,窥视孔优化表示活着。ALIVE-INFER为优化生成正面和负面示例,按需枚举谓词,并学习一组分隔正面和负面示例的谓词。ALIVE-INFER重复这个过程,直到找到一个确保优化有效性的前提条件。ALIVE-INFER向开发人员报告一个最弱的先决条件和一组简洁的部分先决条件。我们的原型生成的先决条件比LLVM的先决条件更弱,用于Alive套件中的73个优化。我们还证明了这种技术的适用性,以推广54优化模式产生的Souper,LLVM~IR-基于超优化。

英文摘要:

Peephole optimizations are a common source of compiler bugs. Compiler developers typically transform an incorrect peephole optimization into a valid one by strengthening the precondition. This process is challenging and tedious. This paper proposes ALIVE-INFER, a data-driven approach that infers preconditions for peephole optimizations expressed in Alive. ALIVE-INFER generates positive and negative examples for an optimization, enumerates predicates on-demand, and learns a set of predicates that separate the positive and negative examples. ALIVE-INFER repeats this process until it finds a precondition that ensures the validity of the optimization. ALIVE-INFER reports both a weakest precondition and a set of succinct partial preconditions to the developer. Our prototype generates preconditions that are weaker than LLVM's preconditions for 73 optimizations in the Alive suite. We also demonstrate the applicability of this technique to generalize 54 optimization patterns generated by Souper, an LLVM~IR--based superoptimizer.

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

↑