paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Language-parametric compiler validation with application to LLVM

语言参数化的编译器验证及其在 LLVM 上的应用
ASPLOS Proceedings of the 26th ACM International Conference on Architectural Support for Programming Languages and Operating Systems2021匹配度 3/10 · 该论文属于程序验证与编译器翻译验证,具备形式化证明和 LLVM 工程落地,但未涉及 LLM/Agent、ML/Agentic 程序静态分析、浮点程序分析或贝叶斯程序分析,与用户研究画像的核心交叉方向无直接关联。引用 17 inbox
Theodoros Kasampalis, Daejun Park, Zhengyao Lin, Vikram S. Adve, Grigore Roşu
crossref: 2026-09-12

AI 速览

一句话:提出语言参数化的程序等价性检查器 Keq,基于割双模拟,并用于 LLVM 指令选择翻译验证。

现代优化编译器如 LLVM 的翻译验证面临挑战:现有系统往往针对特定变换序列和统一输入输出语言定制。本文提出语言参数化的翻译验证设计,将变换相关部分与通用部分解耦,并给出 Keq——首个对输入/输出语言语义参数化、且不依赖具体变换的程序等价性检查器。Keq 基于割双模拟(cut-bisimulation)形式化,并证明其正确性。作者为 LLVM 指令选择 pass 原型化验证系统,可自动证明从 LLVM IR 到 x86-64 MachineIR 的翻译等价,该变换涉及不同语言,此前方法难以处理。实验在 SPEC 2006 的 GCC 程序上评估,Keq 成功证明 4732 个受支持函数中超过 90% 的翻译正确。

问题
现代优化编译器的翻译验证通常依赖特定的变换序列和统一的输入输出语言,难以适用于跨语言的编译变换。
方法
提出语言参数化的翻译验证框架,并实现首个对输入/输出语言语义参数化、与变换无关的程序等价性检查器 Keq,其算法基于割双模拟并经过正确性证明。
评估
为 LLVM 指令选择 pass 构建原型,自动验证 LLVM IR 到 x86-64 MachineIR 的翻译;在 SPEC 2006 的 GCC 基准上,对 4732 个受支持函数中超过 90% 成功证明等价。
原文摘要(Abstract)

We propose a new design for a Translation Validation (TV) system geared towards practical use with modern optimizing compilers, such as LLVM. Unlike existing TV systems, which are custom-tailored for a particular sequence of transformations and a specific, common language for input and output programs, our design clearly separates the transformation-specific components from the rest of the system, and generalizes the transformation-independent components. Specifically, we present Keq, the first program equivalence checker that is parametric to the input and output language semantics and has no dependence on the transformation between the input and output programs. The Keq algorithm is based on a rigorous formalization, namely cut-bisimulation, and is proven correct. We have prototyped a TV system for the Instruction Selection pass of LLVM, being able to automatically prove equivalence for translations from LLVM IR to the MachineIR used in compiling to x86-64. This transformation uses different input and output languages, and as such has not been previously addressed by the state of the art. An experimental evaluation shows that Keq successfully proves correct the translation of over 90% of 4732 supported functions in GCC from SPEC 2006.

链接与引用

DOI 原文 ·

BibTeX
@inproceedings{paperbot6123,
  title = {Language-parametric compiler validation with application to LLVM},
  author = {Theodoros Kasampalis and Daejun Park and Zhengyao Lin and Vikram S. Adve and Grigore Roşu},
  booktitle = {ASPLOS},
  year = {2021},
  doi = {10.1145/3445814.3446751}
}