VOOZH about

URL: https://www.phoronix.com/news/GCC-x86-Generic-Mispredict

⇱ One Line x86 Change To GCC Compiler Nets +12% Benchmark Win For Modern Intel/AMD CPUs - Phoronix


👁 Phoronix

One Line x86 Change To GCC Compiler Nets +12% Benchmark Win For Modern Intel/AMD CPUs

Written by Michael Larabel in GNU on 24 June 2026 at 06:45 AM EDT. 24 Comments
A one line code change to the GNU Compiler Collection (GCC) for its generic x86 tuning is benefiting modern Intel and AMD processors.

Intel software engineer Lili Cui discovered it's quite worthwhile increasing the misprediction cost of the generic x86 tuning for the GCC compiler. On the basis of modern CPUs having deeper pipelines and thus making branch mispredictions more expensive, increasing the cost in the generic tuning table helps avoid pipeline stalls from mispredicted branches. This is for those just relying on the generic x86/x86_64 tuning and not any CPU-specific -march=native type builds.

By simply increasing the branch mispredict scale by three, it was found to increase the performance on Granite Rapids by 12.7% and by AMD Zen 5 for 12.1%. That is for SPEC CPU 2017's 544.nab_r Nucleic Acid Builder (NAB) test case. No other performance numbers were shared in the Git commit/patch but in any event a 12% win for at least one SPEC CPU test case is quite enticing -- especially from changing a single line of code -- and it will be interesting to see the impact on other workloads.

👁 GCC x86 mispredict tuning change


This change is merged in GCC Git for next year's GCC 17 stable release.

Michael Larabel is the principal author of Phoronix.com and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and OpenBenchmarking.org automated benchmarking software. He can be followed via Twitter, LinkedIn, or contacted via MichaelLarabel.com.