# A Multi-Dimensional, Per-Pass Empirical Study of the LLVM Optimization Pipeline

DevFeed: [A Multi-Dimensional, Per-Pass Empirical Study of the LLVM Optimization Pipeline](<https://devfeed.tech/articles/a-multi-dimensional-per-pass-empirical-study-of-the-llvm-optimization-pipeline-96623.md>)

Original publisher: [Read original article](<https://arxiv.org/abs/2606.31238>)

Author: Federico Bruzzone, Walter Cazzola

Published: 2026-10-23T04:00:00Z

Content type: article

Language: en

Sources: [arXiv: Software Engineering](<https://devfeed.tech/sources/arxiv-software-engineering.md>)

Topics: [Programming Languages / Compilers](<https://devfeed.tech/topics/programming-languages-compilers.md>), [LLVM](<https://devfeed.tech/topics/llvm.md>), [performance-optimization](<https://devfeed.tech/topics/performance-optimization.md>)

Tags: [analysis](<https://devfeed.tech/tags/analysis.md>), [cs-pf](<https://devfeed.tech/tags/cs-pf.md>), [cs-pl](<https://devfeed.tech/tags/cs-pl.md>), [cs-se](<https://devfeed.tech/tags/cs-se.md>), [energy](<https://devfeed.tech/tags/energy.md>), [hardware](<https://devfeed.tech/tags/hardware.md>), [kernel](<https://devfeed.tech/tags/kernel.md>), [kernels](<https://devfeed.tech/tags/kernels.md>), [llvm](<https://devfeed.tech/tags/llvm.md>), [measurement](<https://devfeed.tech/tags/measurement.md>), [measurements](<https://devfeed.tech/tags/measurements.md>), [mlir](<https://devfeed.tech/tags/mlir.md>), [model-calibration](<https://devfeed.tech/tags/model-calibration.md>), [optimization](<https://devfeed.tech/tags/optimization.md>), [pass](<https://devfeed.tech/tags/pass.md>), [pipeline](<https://devfeed.tech/tags/pipeline.md>), [runtime](<https://devfeed.tech/tags/runtime.md>), [rust](<https://devfeed.tech/tags/rust.md>), [study](<https://devfeed.tech/tags/study.md>)

## AI overview

The LLVM -O3 pipeline is non-monotone on the 30 compute-bound PolyBench/C kernels studied: 36% of runtime-changing transitions that were significant were regressions, appearing in 28 kernels. The study measures 113 cumulative per-pass prefixes across runtime, compile time, binary size, hardware counters, and RAPL energy, using byte-identical binary transitions to calibrate significance. Speedups tend to arrive late and cluster in a small group of passes; the median kernel requires 84.8% of the pipeline to reach 80% of its speedup. IR instruction count poorly predicts runtime, while runtime-targeted passes also reduce energy by 30-60% in this study. The authors bound speedup lost to non-monotonicity at 46.35%, attributing 9.7 points to measurement noise, 15.3 to dips repaired within three passes, and 21.3 to effects persisting at pipeline end.

## Source excerpt

arXiv:2606.31238v2 Announce Type: replace Abstract: 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 passes, measurement noise, and pipeline scale make this difficult. We present a systematic empirical study of the LLVM -O3 pipeline. We decompose it into 113 cumulative per-pass prefixes and measure execution time, compile time, binary size, hardware counters, and RAPL energy on 30 PolyBench/C kernels (84,750 measurements). Transitions whose binary is byte-identical to their predecessor give us a built-in null distribution, which we use to calibrate every significance claim. On these compute-bound affine kernels, the pipeline is non-monotone: 36% of the transitions that significantly change runtime are regressions, found in 28 of 30 kernels. Gains are back-loaded (the median kernel needs 84.8% of the pipeline for 80% of its speedup) and concentrated in a small core of passes, a result that holds under both absolute and scale-free impact measures. IR instruction count is an unreliable runtime predictor, and runtime-targeted passes are de facto energy-targeted (30-60% savings). Finally, we bound the speedup lost to non-monotone behavior from above by 46.35% and decompose it: 9.7 points are measurement noise, 15.3 points are transient dips repaired within three passes, and only 21.3 points persist to the end of the pipeline. These findings inform pass pruning, cost-model calibration, and autotuning.