一句话:提出通用方法 MOD,通过优化间的人工映射检测编译器遗漏的优化,并在 LLVM 可用表达式上报告 20 个正确告警。
编译器优化遗漏会降低性能,但现有研究多针对特定分析,通用方法又常依赖不同编译器间的差分测试,难以发现多个编译器共有的优化缺陷。本文提出通用方法 MOD:它利用人工构建的优化映射,判断在相同代码上本应一致触发的优化是否同时发生;若一个优化触发而另一个未触发,则表明两者之一存在缺陷。作者将 MOD 实现为工具,用于检测 LLVM 可用表达式分析中遗漏的优化。实验表明,在对随机测试程序进行一小时的检测中,MOD 能报告 20 个正确告警。
With the increasing significance of compilers in software development, identifying optimization bugs and enhancing their performance has become a significant challenge. In recent years, many studies have targeted only specific analyses to identify missed optimizations (e.g., in data flow analyses). While there have been some general approaches, most rely on differential testing between different compilers, which makes it difficult to identify optimization bugs that are common to multiple compilers. This paper tackles these challenges by introducing an effective and general approach called MOD. MOD works by using a manually-curated mapping between optimizations, ensuring that code should be consistently optimized: if one optimization triggers but the other does not, that indicates a bug in either of the two optimizations. We implemented MOD as a tool to detect missed optimizations in the available expressions of the LLVM. Experimental results show that MOD can report 20 correct alerts in one hour of detection of random test programs.