LLVM 15.0 arrives with improvements for different backends, greater support and more

LLVM 15 implements support improvements

LLVM 15.0 also includes a number of interesting updates to C/C++.

After six months of development, LLVM 15.0 project release announced, in which a lot of major changes have been made, as well as added support for new processors, architectures, and more.

For those unfamiliar with LLVM, you should know that this is a GCC compatible compiler (compilers, optimizers, and code generators) that compiles programs into a RISC-like virtual instruction intermediate bitcode (a low-level virtual machine with a multilevel optimization system).

The generated pseudocode can be converted by the JIT compiler into machine instructions just at the time of program execution.

Main new features of LLVM 15.0

In this new version that is presented, it is highlighted that the support for Cortex-M85 processors, as well as for Armv9-A, Armv9.1-A and Armv9.2-A architectures, Armv8.1-M PACBTI-M extensions.

Another change that stands out is that added an experimental DirectX backend which supports DXIL format (DirectX Intermediate Language) used for DirectX shaders. The backend is enabled via the "-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=DirectX" build option.

libc++ continues to implement new features of the C++20 and C++2b standards, including the completion of the "format" library implementation and the proposed experimental version of the "ranges" library.

For the part of the changes related to Clang 15.0 it is mentioned that added experimental support for C-like language HLSL (High-Level Shading Language), which is used for writing shaders starting with DirectX 9, as well as translating HLSL shaders into DirectX 12-compatible DXIL (DirectX Intermediate Language) binary format, as well as SPIR format -V used by Vulkan. In the future, plan to implement support for the DXBC format (DirectX Bytecode) used in DirectX 9-11. The implementation is provided by Microsoft and is based on the DirectX Shader Compiler, released in 2017, built on the basis of LLVM 3.7.

It is also mentioned that it continues with the work to support future C2X and C++23 standards. Implemented for the C language: the noreturn attribute, the false and true keywords, the _BitInt(N) type for integers of a given bit depth, the *_WIDTH macros, the u8 prefix for UTF-8 characters.

In addition to that, has been implemented for C++: module merging, ABI isolation of function members, ordered dynamic initialization of non-local variables in module, multidimensional index operators, auto(x), non-literal variables, goto and labels in functions declared as constexpr, delimited escape sequences, named escape characters.

For systems based on the architecture x86, added "-fzero-call-used-regs" flag, which provides zeroing of all CPU registers used in the function before returning control from the function. this option protects against data leakage of functions and reduce the number of blocks suitable for creating ROP (Return Oriented Programming) devices in exploits by about 20%.

Memory location randomization has been implemented of the structures for C code, which complicates the extraction of data from the structures in case of exploitation of vulnerabilities. Randomization is turned on and off with the randomize_layout and no_randomize_layout attributes, and requires the seed to be set with the "-frandomize-layout-seed" or "-frandomize-layout-seed-file" flag to ensure repeatable builds.

Of the other changes that stand out:

  • Expanded capabilities related to OpenCL and OpenMP support. Added support for the OpenCL extension cl_khr_subgroup_rotate.
  • Improved backends for x86, PowerPC, and RISC-V architectures.
    Improved LLD linker and LLDB debugger capabilities.
  • Added "-fstrict-flex-arrays=" flag » with which you can control the limits of a soft array element in structures (Soft Array Members, an array of indefinite size at the end of the structure).
  • Added "-warray-parameter" option to warn about overriding functions with mismatched argument declarations associated with fixed and variable length arrays.
  • Improved compatibility with MSVC.
  • Added support for the "#pragma function and "#pragma alloc_text" provided in MSVC.
  • Added support for MSVC-compatible /JMC and /JMC flags.
  • Added "-m[no-]rdpru" flag to control the use of the RDPRU instruction, supported from AMD Zen2 processors.
  • Added the "-mfunction-return=thunk-extern" flag to protect against the RETBLEED vulnerability, which works by adding a sequence of instructions that excludes participation of the speculative execution mechanism for indirect jumps.

Finally If you are interested in knowing more about it, you can check the details in the following link


Leave a Comment

Your email address will not be published. Required fields are marked with *

*

*

  1. Responsible for the data: AB Internet Networks 2008 SL
  2. Purpose of the data: Control SPAM, comment management.
  3. Legitimation: Your consent
  4. Communication of the data: The data will not be communicated to third parties except by legal obligation.
  5. Data storage: Database hosted by Occentus Networks (EU)
  6. Rights: At any time you can limit, recover and delete your information.