An AMD compiler engineer posted a patch on Saturday for the GNU Compiler Collection (GCC). The two-line patch adjusts the misprediction cost for Zen 4 and Zen 5 processors, which ends up yielding a 12% improvement in one SPEC CPU benchmark on Zen 5 and a 9% improvement on Zen 4...

An AMD compiler engineer posted a patch on Saturday for the GNU Compiler Collection (GCC). The two-line patch adjusts the misprediction cost for Zen 4 and Zen 5 processors, which ends up yielding a 12% improvement in one SPEC CPU benchmark on Zen 5 and a 9% improvement on Zen 4.
Venkataramanan Kumar of AMD posted the straight-forward patch for bumping up the branch misprediction scale by three for both Zen 4 and Zen 5's cost tables within the GCC compiler. In doing so there is an observed 12% improvement for SPEC CPU's 544.nab_r on Zen 5 and 9% on Zen 4 for the "-O3 -march=native -flto" optimized build in catering to the respective CPUs.
It's possible and likely some other workloads may benefit as well from this adjustment to the branch misprediction cost but for testing purposes with compiler tuning it's commonly done against SPEC CPU.
The patch is out for review on the GCC mailing list. Assuming no issues are brought to light, which shouldn't be the case given the simplicity, it should be part of next year's GCC 17 feature release and potentially back-ported to the GCC 16.3 point release.
While AMD has been doing better at upstreaming their new CPU compiler targets earlier into the GCC and LLVM/Clang open-source compilers (AMD Zen 6 made it into GCC 16 last December), their cost table tuning is one area where they can still make more progress in profiling and tuning ahead of time rather than post-launch. The Znver5 and Znver6 targets in GCC, for example, are still largely relying on the same Znver4 cost table information with various adjustments typically coming months later. Given GCC's long release cycles, this ends up being unfortunate timing in many cases.
| # | Наименование новости | Тональность | Информативность | Дата публикации |
|---|---|---|---|---|
| 1 | Однострочное изменение в GCC привело к ускорению на 12% в одном тесте и замедлению на 14% в другом | 0 | 8 | 24-06-2026 |
| 2 | LLVM 23.1-rc1 Released With AMD Zen 6 & AVX-512 BMM Support, Other Compiler Enhancements | 0 | 12.99 | 23-07-2026 |
| 3 | Intel Posts Initial GCC Compiler Patches For AI Compute Extensions "ACE" | 0 | 7 | 02-07-2026 |
| 4 | AMD Sends Out Latest Linux Patches For RMPOPT Optimization | 0 | 7 | 01-07-2026 |
| 5 | AMD ZenDNN 6.0 Brings Many Improvements For Accelerating Inference On Ryzen/EPYC CPUs | 5 | 7 | 08-07-2026 |
| 6 | AMD Posts Massive Patch Series For Enabling UALink In The Linux Kernel | 0 | 8.46 | 21-08-2026 |
| 7 | AMD Working On A New Backend For Improving ROCm Compute In QEMU/VMs | 0 | 8.49 | 17-08-2026 |
| 8 | Tenstrorrent Posts GCC Compiler Patches For Ascalon XG Core | 0 | 9.53 | 12-08-2026 |
| 9 | AMD P-State Linux Driver Patches Can Boost 1%-Low FPS Gaming Performance By 31% | 0 | 15.98 | 28-07-2026 |