AMD Zen 3 Scheduler Model Finally Added To LLVM/Clang
The initial "-march=znver3" support made it into LLVM 12 but the Zen 3 tuned scheduler model hadn't landed even though the initial scheduler model updates were posted for review in January. It was only this weekend that the Zen 3 scheduler model has now landed within LLVM Git for LLVM 13.0 that will debut as stable in September~October or slightly before that if making a LLVM 12.0.1 release with it back-ported.
This Zen 3 scheduler model was built from scratch relying upon LLVM's llvm-mca machine code analyzer for generating realistic instruction costs, etc. The new scheduler model has seen limited testing/benchmarking so far but should help some workloads with RawSpeed being one noted workload so far that this addition has helped.
This commit adds the 14.3k lines of new code providing the current Zen 3 model. It's too bad though that this didn't land months ago in ensuring good out-of-the-box compiler support at launch at least for AMD EPYC 7003 series or ideally even ahead of the Ryzen 5000 series launch last year. Intel for their part added Icelake-Server to GCC and LLVM/Clang back in 2018 and remains well known for their timely open-source enablement well ahead of launch.
LLVM 13.0 should be out in the September or October timeframe (the LLVM 13 release calendar has yet to be published but their second release of the year usually occurs then, depending upon how it plays out with blocker bugs, etc) so we'll see what more AMD optimizations might land still ahead of this next open-source compiler release.