GCC 13 sees additional and improved AMD Zen 4 CPU target tuning in the recent compiler update patch

This continues with numerous patches added in 2022 for the new version release. It is anticipated that it will be better for AMD Zen 4’s architecture compared to the support shown for Zen 3, which was mediocre at best. We will also see new processor ISA extensions used for the latest architecture, reports Michael Larabel, analyst, and Editor of the Linux hardware website Phoronix. Yesterday, Hubicka added the newest updates for GCC 13, which we have supplied the patch notes below that were posted to GNU Compiler Collection’s Git page: This patch adds more tunes for zen4:

new tunes for avx512 scater instructions. In micro-benchmarks, these seem consistent losses compared to open-coded come disable the use of gather for zen4 While these are a win for micro benchmarks (based on TSVC), an enabling gather is a loss for parest. So, for now, it seems safe to keep it off.

disable pass to avoid FMA chains for znver4 since fmadd was optimized and does not seem to cause regressions.

Larabel notes that GCC 13 and AMD’s proprietary AOCC 4.0 compiler will be needed to test to see which is better “as a downstream of LLVM/Clang.” AMD recently added the beginning enablement of the Zen 4 architecture into LLVM/Clang early last month, but it has not been touched since. The hope is that we will see more in the coming weeks. The Phoronix editor also mentions that “-march=znver4 can be used if wanting to cater the compiler’s instructions and optimizations to the AMD Ryzen 7000 series and AMD EPYC 9004 series processors”. At the same time, we are waiting for more updates to happen. Lately, AMD appears to have focused heavily on the AMDGPU work for DRM-Next, as was reported yesterday. Several targets were initially not supported, and it is pleasant to see that work is now added to upcoming patches within the various open-source projects to prepare for Q1 releases. News Source: Phoronix