LLVM 5.0 Should Offer Better AMD Ryzen Performance

Since January there's been Zen tuning in LLVM Clang with the "znver1" flag, similar to the znver1 tuning in GCC that's been in place since 2015. While LLVM Clang 4.0 has the initial znver1 support, it's incomplete.
In LLVM/Clang 4.0 and currently in SVN/Git master, znver1 is relying upon the btver1 scheduler model. Btver1 is for AMD's Bobcat.
A PhD student has realized he can squeeze better AMD Ryzen performance of generated binaries by LLVM Clang if switching to Haswell's scheduler model rather than btver2, about 5~10% better performance of the generated binaries, but that's still not as ideal as having a proper Zen scheduler model for LLVM Clang.
Dans Dibyendu of AMD India has responded to LLVM's lack of a Zen scheduler model, "Yes we are working on the scheduler and we will upstream by llvm 5.0."
Longtime LLVM developer Hal Finkel also commented that while LLVM is good at being architecture independent, there isn't as much effort around AMD CPUs with their x86 back-end. This sounds due in part due to lack of as much AMD hardware and testers as they have on the Intel side, but they welcome AMD performance bug reports and information to help them optimize for AMD hardware.
LLVM 5.0 won't be released for about six months, but hopefully the scheduler will soon be introduced in mainline LLVM so it will be easier for interested individuals to try out and see how it impacts the AMD Ryzen performance. I'll certainly run some fresh AMD Ryzen compiler benchmarks when the code is updated -- for now see my current Ryzen GCC compiler tuning and GCC vs. Clang Ryzen benchmarks.
8 Comments