paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Seeking Evidence of Further Optimization: Detecting Missed Optimizations through Compiler’s Native Analyses

寻找进一步优化的证据:通过编译器原生分析检测遗漏的优化
OOPSLA 10(OOPSLA2)2026匹配度 3/10 · 论文属于编译器静态分析与遗漏优化检测,和用户关注的 PL/静态分析背景有间接关联;但它不涉及 LLM/Agent、浮点程序分析或贝叶斯程序分析等核心交叉方向。其工业级 LLVM 基准与落地影响虽符合部分偏好,但整体不在研究画像的核心问题上。引用 0 inbox
Yi Zhang, Yu Wang, Ke Wang, Linzhang Wang
crossref: 2026-10-02

AI 速览

一句话:提出利用编译器原生分析检测遗漏优化,在LLVM上发现31,616处机会并推动20个问题修复。

现有遗漏优化检测难以可靠判断某优化是否已应用,在真实软件上泛化能力不足。本文提出新视角:利用编译器原生分析直接检查优化后的输出,识别仍可进一步优化的代码区域,作为遗漏优化的证据。方法包含两种策略:查询与目标遗漏优化无关的分析,复用其推理结果;将代码重写为语义保持形式以激活原本不兼容的分析。基于LLVM在LLVM Opt Benchmark全部219个项目上评估,发现31,616处遗漏优化机会。向LLVM开发者报告25个问题,20个已修复或确认;应用官方补丁后,受影响软件运行时加速最高12.96%,编译时间降低最高7.55%。

问题
现有遗漏优化检测难以可靠判断某优化是否已应用,导致其难以泛化到真实软件。
方法
利用编译器原生分析检查优化后的输出,识别仍可优化的区域;具体采用查询无关分析和语义保持重写两种策略激活分析。
评估
基于LLVM在LLVM Opt Benchmark的219个真实项目上评估,发现31,616处遗漏优化,报告25个问题(20个已修复/确认),补丁带来最高12.96%运行时加速和7.55%编译时间降低。
原文摘要(Abstract)

Compilers are central to software performance, yet even mature optimization pipelines such as LLVM's and GCC's often miss optimization opportunities. Existing approaches for detecting missed compiler optimizations are constrained by the challenge of reliably determining whether a specific optimization has been applied, leading to a fundamental weakness in their ability to generalize to real-world software. This paper presents a new perspective for detecting missed compiler optimizations. The key idea is utilizing compiler's native analyses to directly examine the compiler's optimized output and identify code regions that remain further optimizable---evidence that some optimization opportunities were missed. We develop two strategies to realize this idea: one that queries analyses independent of the missed optimization, effectively leveraging their otherwise unused reasoning results, and another that rewrites code into semantics-preserving forms to activate otherwise incompatible analyses. We conduct an extensive evaluation of our approach on LLVM using all 219 projects from LLVM Opt Benchmark, a suite used by LLVM developers to measure the performance impact of compiler updates on real-world software. Across these programs, our tool discovers 31,616 missed optimization opportunities. By analyzing them, we have identified and reported 25 issues to LLVM developers; 20 have already been patched or confirmed. Applying LLVM official patches to our reported issues consistently yielded runtime speedups of up to 12.96% for affected software and compile-time reductions of up to 7.55%.

链接与引用

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

BibTeX
@article{paperbot12158,
  title = {Seeking Evidence of Further Optimization: Detecting Missed Optimizations through Compiler’s Native Analyses},
  author = {Yi Zhang and Yu Wang and Ke Wang and Linzhang Wang},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {10},
  number = {OOPSLA2},
  year = {2026},
  doi = {10.1145/3839454}
}