LLVM 15.0 Released With Security Features, Experimental DirectX Back-End, New AMD GPUs
LLVM 15.0 brings a number of new x86-related security features, support for Armv9, experimental HLSL and DirectX work from Microsoft, new AMD RDNA3 and GFX940 support in their shader compiler back-end, more RISC-V instructions now supported, and a variety of other enhancements throughout this massive compiler stack.
There are a number of new x86 security features/mitigations in LLVM 15 from Straight-Line Speculation to Retbleed bits.
LLVM 15.0 was tagged this morning and can be downloaded from GitHub.
On the Clang C/C++ front-end side, Clang 15.0 highlights include:
- Support for the "-fzero-call-used-regs" option on x86/x86_64 that is similar to what has been added to GCC. The -fzero-call-used-regs option can be used to limit ROP / COP / JOP attacks by zeroing out a selected class of registers before function return.
- Support for the "-mharden-sls=" option on x86/x86_64 for Straight-Line Speculation hardening.
- Support for the "-mfunction-return=thunk-extern" option that will be used by the Linux kernel as part of Retbleed mitigations.
- Support for the _Float16 type on x86 for all targets with SSE2 support. The _Float16 type is native for AVX-512 FP16 or emulated using float.
- Support for randomizing the structure layout in C. This is a compile-time hardening technique and can be activated with the "randomize_layout" attribute.
- Experimental support for Microsoft's HLSL shader language. HLSL in Clang 15.0 is still "highly experimental" and "incomplete". This is part of the effort by Microsoft for adding DirectX and HLSL to the upstream LLVM/Clang codebase.
- The -fexperimental-max-bitint-width= option is added to control the maximum allowed bit width for _BitInt types beyond the default 128 bits. There are also a number of other new compiler flags added, mostly of limited scope / niche uses.
- Support for more MSVC pragmas as well as support for more MSVC-compatible flags in clang-cl for the Windows support.
- Many feature additions around the still-maturing C2X language support. Among the C2X features implemented for this release are the "noreturn" attribute, a fundamental type for N-bit integers, the u8 character prefix, removed support for implicit function declarations, and more.
- Additional C++20 feature support around modules, ABI isolation for member functions, and more.
- Support for some C++2b features like the multi-dimensional subscript operator, delimited escape sequences, named universal character escapes, and more.
- OpenMP 5.1 support for atomic compare and atomic compare capture.
- Updates to RISC-V's vector intrinsics, support for RISC-V scalar crypto "K" extensions, CLZ / CTX instructions, and more.
- Many bug fixes and diagnostics / compiler warning improvements.
Aside from the Clang C/C++ compiler front-end, other LLVM 15.0 changes include:
- Support for Armv9-A, Armv9.1-A, and Armv9.2-A architectures. There is also Arm Cortex-M85 CPU support added.
- The experimental DirectX back-end going along with the mentioned HLSL changes in Clang. The DirectX back-end targets the DXIL architecture used for DirectX GPU shader programs.
- Support for the RDPRU instruction on AMD Zen 2 and newer CPUs.
- An HTTP server for Debuginfod.
- Initial SPIR-V back-end work.
- Support for the half type on SSE2-capable x86 CPUs as part of the _Float16 type added to Clang.
- LLVM now using opaque pointers for LLVM IR.
- AMD work for RDNA3/GFX11 graphics and GFX940 for next-gen CDNA.
- Support for 8 and 16-bit atomic loads and stores with the AMDGPU back-end.
LLVM 15.0 also includes a number of updates and additions to the libc++ 15.0 sub-project too.
I'll have up some fresh LLVM/Clang 15 compiler benchmarks soon on Phoronix.