GCC Patch Adjusting AMD Zen 5 Misprediction Cost Nets 12% Win In Benchmark

GCC Patch Adjusting AMD Zen 5 Misprediction Cost Nets 12% Win In Benchmark

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.

Original Source

Read the full article at Phoronix →

KhanList aggregates and links to publicly available news content. We do not host full articles from third-party sources. Always verify important information with original sources.