paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Synchronized Behavior Checking: A Method for Finding Missed Compiler Optimizations

同步行为检查:一种发现遗漏编译器优化的方法
OOPSLA 9(OOPSLA2)2025匹配度 3/10 · 该论文属于编译器优化缺陷检测,利用优化间协同行为发现遗漏优化,与 PL/静态分析有弱关联,且在 LLVM/GCC 上有较强工程评估。但它不涉及用户核心关注的 LLM/Agent、ML/Agentic 程序静态分析、浮点程序分析或贝叶斯程序分析,因此匹配度较低。引用 0 inbox
Yi Zhang, Yu Wang, Linzhang Wang, Ke Wang
crossref: 2026-09-10

AI 速览

一句话:提出同步行为检查(SBC),通过交叉验证多个优化的协同行为来检测编译器遗漏的优化。

现代编译器的优化阶段规模庞大且复杂,常出现“遗漏优化”(missed optimization),即本可应用的优化未被应用,导致生成代码错失效率提升。本文提出同步行为检查(SBC),其核心思想是利用优化之间的协同行为进行交叉验证:一个优化的结果可验证另一个优化所需条件是否满足。具体实现基于两类关系同时交叉验证两个优化——共现关系下,若某优化因特定语义约束被应用,则依赖同一约束的另一优化也应被应用;互补关系下,若两个优化由互补语义约束使能,则应恰好应用其中之一。当按上述关系某个优化本应被应用却未被应用时,即判定为遗漏优化。作者在 LLVM 与 GCC 两个工业级编译器上开展广泛评估,检测出大量遗漏优化,涉及多种编译器分析,并向二者报告 101 个问题,其中 84 个已确认,39 个已修复或安排修复。

问题
现代编译器优化阶段复杂,常出现本可应用却未应用的遗漏优化,这类问题难以自动检测。
方法
提出同步行为检查 SBC,基于共现与互补两类关系交叉验证两个优化的协同行为,将违反关系的情形判定为遗漏优化。
评估
在 LLVM 和 GCC 上进行广泛评估,发现大量遗漏优化并涉及多种编译器分析,共报告 101 个问题,84 个已确认,39 个已修复或安排修复。
原文摘要(Abstract)

Compilers are among the most foundational software ever developed. A critical component of a compiler is its optimization phase, which enhances the efficiency of the generated code. Given the sheer size and complexity of modern compilers, automated techniques for improving their optimization component have been a major area of research. This paper focuses on a specific category of issues, namely missed optimizations, where compilers fail to apply an optimization that could have made the generated code more efficient. To detect missed optimizations, we propose Synchronized Behavior Checking ( SBC ), a novel approach that cross-validates multiple optimizations by leveraging their coordinated behaviors. The key insight behind SBC is that the outcome of one optimization can validate whether the conditions required for another optimization were met. For a practical implementation of SBC , we cross-validate two optimizations at once based on two kinds of relationships — co-occurring and complementary. In the co-occurring relationship, if an optimization is applied based on a specific semantic constraint ( i.e ., optimization condition) from an input program, another optimization, which depends on the same semantic constraint, should be applied as well. Second, when two optimizations are enabled by complementary semantic constraints, exactly one of the two optimizations should be applied. When an optimization should have been applied (according to either relationship) but was not applied, we regard it as a missed optimization. We conduct an extensive evaluation of SBC on two state-of-the-art industry compilers LLVM and GCC. SBC successfully detects a large number of missed optimizations in both compilers, in particular, they are caused by a wide range of compiler analyses. Based on our evaluation results, we reported 101 issues to LLVM and GCC, out of which 84 have been confirmed, and 39 have been fixed or assigned (for planned fixes). SBC opens up a new, exciting direction for finding missed compiler optimizations.

链接与引用

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

BibTeX
@article{paperbot2970,
  title = {Synchronized Behavior Checking: A Method for Finding Missed Compiler Optimizations},
  author = {Yi Zhang and Yu Wang and Linzhang Wang and Ke Wang},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {OOPSLA2},
  year = {2025},
  doi = {10.1145/3763105}
}