Seeking Evidence of Further Optimization: Detecting Missed Optimizations through Compiler’s Native Analyses
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%.
Mon 5 OctDisplayed time zone: Pacific Time (US & Canada) change
13:30 - 15:00 | Testing Compilers and SolversOOPSLA at Junior Ballroom 3&4 Chair(s): Harrison Goldstein University at Buffalo | ||
13:30 18mTalk | BackSmith: A Systematic Approach to Testing Compiler Backends OOPSLA Hongyu Chen Nanjing University, Yu Wang Nanjing University, Jianhua Zhao Nanjing University, Ke Wang Nanjing University DOI | ||
14:06 18mTalk | Seeking Evidence of Further Optimization: Detecting Missed Optimizations through Compiler’s Native Analyses OOPSLA Yi Zhang Nanjing University, Yu Wang Nanjing University, Ke Wang Nanjing University, Linzhang Wang Nanjing University DOI | ||
14:24 18mTalk | Validating Optimizing SMT Solvers via Cross-Theory Approximation OOPSLA Maolin Sun Nanjing University, Fuqi Jia Institute of Software at Chinese Academy of Sciences; University of Chinese Academy of Sciences, Yibiao Yang Nanjing University, Yuming Zhou Nanjing University DOI | ||