Search papers, labs, and topics across Lattice.
This study conducts a comprehensive empirical analysis of the LLVM -O3 optimization pipeline, examining the impact of individual optimization passes on execution time, compile time, binary size, and energy consumption across 84,750 measurements. The results reveal that the optimization pipeline is non-monotone, with a significant percentage of transitions leading to regressions, and that most performance gains are concentrated in a small set of core passes. Additionally, the findings challenge conventional wisdom regarding the relationship between IR instruction count and runtime, highlighting the potential for substantial energy savings through targeted optimizations.
The LLVM -O3 optimization pipeline is non-monotone, with 6.6-9.7% of transitions resulting in regressions, revealing that conventional optimization strategies may overlook critical interactions among passes.
Quantifying the marginal impact of individual optimization passes underpins phase ordering, pass selection, optimization design, and analysis of pass/hardware interactions. In LLVM -- the standard backend for C/C++, Rust, and ML stacks via MLIR -- interactions among optimization passes, measurement noise, and pipeline scale make this difficult. We present a systematic, empirical study of the LLVM -O3 optimization pipeline. We decompose the pipeline into cumulative per-pass prefixes. We then measure execution time, compile time, binary size, hardware counters, and RAPL energy across 84,750 measurements covering 113 cumulative prefixes of the -O3 pipeline evaluated on 30 PolyBench/C kernels under rigorous noise mitigation. On these compute-bound affine kernels, the pipeline is non-monotone (6.6-9.7% of transitions regress) and strongly back-loaded (the median non-regressing kernel needs 84.8% of the pipeline for 80% of its speedup). Most gains are driven by a small Pareto-dominant core of passes, while the final -O3 configuration is Pareto-dominated on (size, speedup) for 29 of 30 kernels. We further show that IR instruction count is an unreliable predictor of runtime, that runtime-targeted passes are de facto energy-targeted (30-60% savings), and that the search-free idealized-additive upper bound on losses due to phase interference is 46.35%. These findings enable more informed pass pruning, cost-model calibration, and autotuning.