What's New in LLVM

Original author: Serdar Yegulalp
  • Transfer
LLVM 6 reduces Specter danger, has improved support for Intel's Windows and CPUs, and also includes WebAssembly among the supported target platforms.

The LLVM compiler infrastructure has gone from a technically curious thing to a living part of the modern software landscape. This is the core behind the Clang compiler, behind the Rust and Swift compilers, and provides ample opportunity to develop compilers for new languages.

It is also a fairly fast-paced project; its major releases come out every six months or close to it. Version 6.0, recently released, continues LLVM's mission to deepen and expand its support for various target platforms. The update also adds some patches against recently discovered processor-level vulnerabilities.

LLVM added partial Specter protection

Vulnerabilities CPU Specter and Meltdown exploit the speculative execution features of modern processors. They are difficult to fix, since they require changing both the microcode of the CPU and the existing software.

To ensure that applications built using LLVM also contribute to the fight against these vulnerabilities, LLVM offers support for the so-called “retpolines”, software constructs that partially reduce the possibility of a Specter attack. In order to use this feature, you need to recompile programs with LLVM 6.0 with the -mretpoline switch.

Improved debugging LLVM CodeView for Windows

Microsoft Windows uses debugging information stored in CodeView format similar to the DWARF format used on Linux systems.

LLVM had previously added support for CodeView, as part of a common effort to develop LLVM for Windows, and to improve the state of debugging tools for Windows using CodeView.

LLVM 6 further improves this support, both through help from Microsoft and through careful reverse engineering from the LLVM team. Long-term plans are to improve CodeView support to the point where languages ​​other than C / C ++ compiled in LLVM can reliably use CodeView in their tools.

LLVM supports WebAssembly as a link target

WebAssembly, a binary format for web browser applications, began to evolve from the experimental stage to the stage used in production technology. A key part of the WebAssembly toolchain, the same as Emscripten and PNaCL, is LLVM.

The last step in supporting the WebAssembly link in LLVM was the wasm-ld tool. This tool receives the assembler created in LLVM (target wasm32-unknown-unknown-wasm) at the input and generates a ready-to-use binary file WebAssembly.

WebAssembly support is still incomplete, and work on WebAssembly is still ongoing, but LLVM will remain a key element of the WebAssembly stack.

LLVM improved Intel CPU support

LLVM programs now have the ability to use instructions from many Intel processor families: Sandy Bridge, Ivy Bridge, Haswell, Broadwell, and Skylake. Intel Icelake is now also supported.

LLVM is currently generating code for Intel processors using vector extensions: VAES, GFNI, VPCLMULQDQ, AVX512VBMI2, AVX512BITALG, and AVX512VNNI.

Code generation is improved for various operations of Intel processors, such as memory comparisons, vector truncations, and vector multiplication by a 32-bit integer value.

Also popular now: