paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Finding missed optimizations through the lens of dead code elimination

通过死代码消除的视角发现遗漏的优化
ASPLOS Proceedings of the 27th ACM International Conference on Architectural Support for Programming Languages and Operating Systems2022匹配度 2/10 · 该论文属于编译器遗漏优化检测与测试方向,虽涉及程序分析中的死代码消除,但不涉及用户核心关注的LLM/Agent与静态分析交叉、浮点程序分析或贝叶斯程序分析。引用 59 inbox
Theodoros Theodoridis, Manuel Rigger, Zhendong Su
crossref: 2026-09-12dblp: 2026-09-12

AI 速览

一句话:提出以死代码消除为透镜自动发现编译器遗漏优化的通用方法,并在GCC/LLVM上发现大量问题。

编译器优化日益复杂,自动发现遗漏优化十分困难;现有方法要么定位不准确,要么仅针对特定分析。本文提出一种简单通用的新方法:在程序基本块中插入“优化标记”,据此计算活跃/死基本块,并依据编译器消除死块的程度来识别遗漏优化。其核心洞察是死代码消除(DCE)高度依赖整个优化流水线,可借此系统量化编译器的优化能力。作者对GCC和LLVM进行了广泛分析,给出了关于其优化能力的定量与定性见解,并发现多种遗漏优化,最终提交84个缺陷报告,其中62个已被确认或修复。

问题
如何自动、准确地发现编译器遗漏的优化,并克服现有方法定位不准或仅针对特定分析的限制。
方法
通过向基本块插入优化标记,计算程序的活跃/死基本块,再根据编译器对这些死块的消除效果来识别遗漏优化,并以DCE为透镜量化优化流水线表现。
评估
在GCC和LLVM上进行大规模实验,分析其优化能力并发现多种遗漏优化;结果产生84个缺陷报告,其中62个已被确认或修复。
原文摘要(Abstract)

Compilers are foundational software development tools and incorporate increasingly sophisticated optimizations. Due to their complexity, it is difficult to systematically identify opportunities for improving them. Indeed, the automatic discovery of missed optimizations has been an important and significant challenge. The few existing approaches either cannot accurately pinpoint missed optimizations or target only specific analyses. This paper tackles this challenge by introducing a novel, effective approach that --- in a simple and general manner --- automatically identifies a wide range of missed optimizations. Our core insight is to leverage dead code elimination (DCE) to both analyze how well compilers optimize code and identify missed optimizations: (1) insert "optimization markers" in the basic blocks of a given program, (2) compute the program's live/dead basic blocks using the "optimization markers", and (3) identify missed optimizations from how well compilers eliminate dead blocks. We essentially exploit that, since DCE heavily depends on the rest of the optimization pipeline, through the lens of DCE, one can systematically quantify how well compilers optimize code. We conduct an extensive analysis of GCC and LLVM using our approach, which (1) provides quantitative and qualitative insights regarding their optimization capabilities, and (2) uncovers a diverse set of missed optimizations. Our results also lead to 84 bug reports for GCC and LLVM, of which 62 have already been confirmed or fixed, demonstrating our work's strong practical utility. We expect that the simplicity and generality of our approach will make it widely applicable for understanding compiler performance and finding missed optimizations. This work opens and initiates this promising direction.

链接与引用

DOI 原文 · DBLP

BibTeX
@inproceedings{TheodoridisR022,
  title = {Finding missed optimizations through the lens of dead code elimination},
  author = {Theodoros Theodoridis and Manuel Rigger and Zhendong Su},
  booktitle = {ASPLOS},
  year = {2022},
  doi = {10.1145/3503222.3507764}
}