AMD Zen 3 Support Published For The LLVM Clang Compiler
After Zen 3 support was sent out and merged into GCC 11 last week, the LLVM Clang compiler support has now been published for this newest member of the AMD Zen family.
The LLVM/Clang equivalent to last week's GCC enablement patch is now under review. The LLVM patch introduces the -march=znver3 target (and wires up the -march=native support). But like the GCC support is currently basic in that it flips on the now-supported instructions but doesn't yet have any optimized cost tables / scheduler model for helping to generate optimized code that will really roar on Zen 3... Those optimizations to the Znver3 target are expected in the coming months.
On top of Zen 2, the new instructions present with Zen 3 include: INVPCID (Invalidate Process-Context Identifier), PKU (Memory Protection Keys), VAES (Vector AES), VPCLMULQDQ (Carry-Less Multiplication Quadword), SNP (Secure Nested Paging), INVLPGB (Invalidate TLB with Broadcast), and TLBSYNC (TLB Synchronization).
The new Znver3 target for LLVM is currently being reviewed but there is sufficient time still that it should land for the LLVM Clang 12 release due out around March. We'll see though in time for that release whether any of the optimizations for Zen 3 are published.
Coming out later today I do have the initial GCC Znver3 benchmarks to publish along with other compiler optimization levels on Ryzen 5000 series hardware.