paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Refined Input, Degraded Output: The Counterintuitive World of Compiler Behavior

精细输入,退化输出:编译器行为的反直觉世界
PLDI 8(PLDI)2024匹配度 3/10 · 论文研究编译器优化中额外静态信息(死代码、值域)反而导致更差代码的问题及自动化测试,属于程序分析与编译优化范畴,但与用户关注的 LLM/Agent 与静态分析交叉、浮点程序分析、贝叶斯程序分析均无直接关联。引用 15 inbox
Theodoros Theodoridis, Zhendong Su
dblp: 2026-09-10crossref: 2026-09-10

AI 速览

一句话:揭示编译器在获得更精确信息(死代码、值域)后反而生成更差代码,并自动化测试发现此类问题。

论文系统研究编译器优化中“更多信息导致更差输出”的反直觉现象。作者关注两类信息:死代码(程序点是否不可达)与值范围(变量在特定程序点的可能取值)。方法是对种子程序进行信息精化,比较精化前后生成代码的质量,从而检测优化退化。作者实现全自动测试方法,并在 GCC 与 LLVM 上大规模评估,量化该问题的存在与普遍程度。共报告 59 个案例,其中 55 个已被确认或修复。该工作揭示编译器组件交互与阶段排序问题,为理解和改进编译器开辟新方向。

问题
编译器通常假设更精确的程序信息会带来更好优化,但组件交互和阶段排序可能导致信息增加反而使优化变差;论文量化这一现象。
方法
对种子程序添加死代码和值范围信息并精化,比较生成代码性能,构建全自动测试方法检测优化退化。
评估
在 GCC 和 LLVM 上进行广泛评估与分析,共报告 59 个案例,其中 55 个已被确认或修复。
原文摘要(Abstract)

To optimize a program, a compiler needs precise information about it. Significant effort is dedicated to improving the ability of compilers to analyze programs, with the expectation that more information results in better optimization. But this assumption does not always hold: due to unexpected interactions between compiler components and phase ordering issues, sometimes more information leads to worse optimization. This can lead to wasted research and engineering effort whenever compilers cannot efficiently leverage additional information. In this work, we systematically examine the extent to which additional information can be detrimental to compilers. We consider two types of information: dead code, i.e ., whether a program location is unreachable, and value ranges, i.e ., the possible values a variable can take at a specific program location. Given a seed program, we refine it with additional information and check whether this degrades the output. Based on this approach, we develop a fully automated and effective testing method for identifying such issues, and through an extensive evaluation and analysis, we quantify their existence and prevalence in widely used compilers. In particular, we have reported 59 cases in GCC and LLVM, of which 55 have been confirmed or fixed so far, highlighting the practical relevance and value of our findings. This work’s fresh perspective opens up a new direction in understanding and improving compilers.

链接与引用

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

BibTeX
@article{TheodoridisS24,
  title = {Refined Input, Degraded Output: The Counterintuitive World of Compiler Behavior},
  author = {Theodoros Theodoridis and Zhendong Su},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {8},
  number = {PLDI},
  year = {2024},
  doi = {10.1145/3656404}
}