GCC 15 Squeezes In Some Last Minute Adjustments For AMD Zen 5 "znver5"
- Reference: 0001540887
- News link: https://www.phoronix.com/news/GCC-15.1-Last-Minute-Znver5-Bit
- Source link:
There are some last minute adjustments happening to the GCC 15 compiler around its AMD Zen 5 optimizations for the EPYC 9005 and Ryzen 9000 series / Ryzen AI 300 series processors.
[3]
First up, the znver5 issue rate was lowered from 6 to 4. [4]The commit explains:
"This patch sets issue rate of znver5 to 4. With current model, unless a reservation is missing, we will never issue more than 4 instructions per cycle since that is the limit of decoders and the model does not take into acount the fact that typically code is run from op cache."
[5]Another patch merged to GCC Git today adjusts the ADDSS/SD SUBSS/SD instructions cost from 2 to 3. The rationale there is:
"Set ADDSS cost to 3 for znver5
Znver5 has latency of addss 2 in typical case while all earlier versions has latency 3. Unfortunately addss cost is used to cost many other SSE instructions than just addss and setting the cost to 2 makes us to vectorize 4 64bit stores into one 256bit store which in turn regresses imagemagick.
This patch sets the cost back to 3. Next stage1 we can untie addss from the other operations and set it correctly."
Those two patches were authored by SUSE compiler engineer Jan Hubicka.
While AMD has a growing compiler team and contributes a lot to LLVM and their LLVM-downstream AOCC, when it comes to GCC AMD has traditionally relied on their partners at SUSE for carrying out most of the AMD Zen target upstreaming and various compiler optimization tuning for their processors. We'll see if any other late Znver5 changes make it into the compiler ahead of the upcoming GCC 15.1 stable release.
Fresh GCC 15 AMD and Intel compiler performance benchmarks upon the GCC 15.1 release.
[1] https://www.phoronix.com/search/GCC+15
[2] https://www.phoronix.com/search/znver5
[3] https://www.phoronix.com/image-viewer.php?id=2025&image=gcc_15_zen5_lrg
[4] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=4a01869b963520d689fe9242cf2ff24984ea41d8
[5] https://gcc.gnu.org/git/?p=gcc.git;a=commit;h=e2011ab13de3e70774f869b356f5f9c750780b34
phoronix