paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Formally verified speculation and deoptimization in a JIT compiler

JIT 编译器中形式化验证的推测与去优化
POPL 5(POPL)2021匹配度 3/10 · 该论文属于形式化验证与编译器优化方向,虽与用户关注的“AI→PL”中的形式化验证有间接关联,但完全不涉及LLM/Agent、静态分析ML/Agent系统、浮点程序分析或贝叶斯程序分析,与核心研究画像匹配度低。引用 39 inbox
Aurèle Barrière, Sandrine Blazy, Olivier Flückiger, David Pichardie, Jan Vitek
crossref: 2026-09-10

AI 速览

一句话:提出显式化去优化同步点与推测假设的 JIT 中间表示,并在证明助手中验证若干推测优化。

动态语言的即时(JIT)编译器常基于可能在运行时失效的假设生成代码,以此针对常见情形特化程序、规避冷路径开销,但这类软件推测必须能在假设失败时进行去优化。本文提出一个模型化的 JIT 编译器,其核心是一个中间表示:它显式地刻画了用于去优化的同步点以及编译器推测所依赖的假设。基于该表示,作者给出若干可借助推测生成更优代码的常见编译器优化,并在证明助手中机器化地证明了这些优化的正确性。尽管工作尚未覆盖原生代码生成的验证,但论文展示了如何将已验证的优化嵌入端到端流程,从而获得显著的性能加速。

问题
动态语言 JIT 编译器基于可能在运行时失效的假设生成特化代码,需要去优化机制,但这类推测与去优化的正确性缺乏形式化保证。
方法
设计一种显式表示去优化同步点与推测假设的中间表示,建模 JIT 编译器,并实现若干利用推测的优化,用证明助手机器化验证其正确性。
评估
在证明助手中机器化证明优化的正确性,并展示如何用已验证优化在端到端环境中获得显著加速(未验证原生代码生成)。
原文摘要(Abstract)

Just-in-time compilers for dynamic languages routinely generate code under assumptions that may be invalidated at run-time, this allows for specialization of program code to the common case in order to avoid unnecessary overheads due to uncommon cases. This form of software speculation requires support for deoptimization when some of the assumptions fail to hold. This paper presents a model just-in-time compiler with an intermediate representation that explicits the synchronization points used for deoptimization and the assumptions made by the compiler's speculation. We also present several common compiler optimizations that can leverage speculation to generate improved code. The optimizations are proved correct with the help of a proof assistant. While our work stops short of proving native code generation, we demonstrate how one could use the verified optimization to obtain significant speed ups in an end-to-end setting.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot1179,
  title = {Formally verified speculation and deoptimization in a JIT compiler},
  author = {Aurèle Barrière and Sandrine Blazy and Olivier Flückiger and David Pichardie and Jan Vitek},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {5},
  number = {POPL},
  year = {2021},
  doi = {10.1145/3434327}
}