What’s new in LLVM

综合技术 2018-03-10

The LLVM compiler framework
has gone from being a technological curiosity to a vital piece of the modern software landscape. It is the engine behind the Clang compiler, as well as the compilers for the Rust and Swift languages, and provides a powerful toolkit for creating new languages.

It is also a fairly fast-moving project, with major point revisions announced every six months or so. Version 6.0, released earlier this month, continues LLVM’s ongoing mission to deepen and broaden support for a variety of compilation targets. The update also adds many timely fixes to guard against recently discovered processor-level system attacks.

LLVM adds partial Spectre protection

The “Spectre” and “Meltdown” CPU exploits
take advantage of speculative execution features in modern processors. Because they must be addressed by a combination of CPU microcode updates and changes to existing software, they are difficult to fix.

To ensure that applications built with LLVM can do their part to guard against such attacks, LLVM now offers support for ”retpolines,”
a software construction that partly alleviates one of the varieties of the Spectre attack.
To make use of it, you’ll need to use LLVM 6.0 to recompile the software in question using the -mretpoline
command line switch.

LLVM CodeView debugging for Windows improved

Microsoft Windows uses debug information stored in a format called the CodeView format, analogous to the DWARF format used in Linux systems.

LLVM previously added support for working with CodeView
, as part of a general push toward making LLVM a better citizen on Windows
, and leveraging the wealth of debugging tools in Windows that use CodeView.

LLVM 6 further improves that support, thanks to some support from Microsoft and some diligent reverse engineering on behalf of the LLVM team. The long-term idea is to improve CodeView support to the point where LLVM-compiled languages other than C/C++ (for instance, by way of the Clang compiler) can make robust use of CodeView and its tools.

LLVM supports WebAssembly as a linking target

WebAssembly, the binary format for applications delivered in a web browser, is starting to evolve from an experiment into a production technology. Key parts of the WebAssembly toolchain, such as Emscripten and PNaCL, use LLVM.

The latest step is support in LLVM’s linker tools for WebAssembly, by way of
the wasm-ld
command-line tool

. This tool ingests assembly created by LLVM when using the wasm32-unknown-unknown-wasm
target, and emits web-ready WebAssembly binaries.

Support for WebAssembly is still necessarily incomplete, as WebAssembly itself is a work in progress, but LLVM is likely to remain a key element in the WebAssembly stack.

LLVM improvements to Intel CPU support

LLVM programs can now take advantage of instruction scheduling on many families of Intel processor: Sandy Bridge, Ivy Bridge, Haswell, Broadwell, and Skylake. The Intel Icelake CPU is now a supported target, too.

LLVM now supports emitting intrinsics that work with Intel processor extensions used for vector processing: VAES, GFNI, VPCLMULQDQ, AVX512VBMI2, AVX512BITALG, and AVX512VNNI.

Code generation has been improved overall for various operations on Intel processors, such as memory comparisons, vector truncations, and vector multiplication with 32-bit integer values.


责编内容by:InfoWorld (源链)。感谢您的支持!


My First LLVM Compiler 21 February 2015 A walkthrough of writing a basic compiler with LLVM. No pr...
GraalVM: 1.0-rc2 is here Wewrote about GraalVM a couple of months ago so we’re happy to see that thin...
LLVM学习笔记(12) 3.3.5. 信息的完善 在RegisterInfoEmitter::run,接下来执行CodeGenRegBank::computeDerivedInf...
LLVM学习笔记(14) X86GenRegisterInfo的定义 CodeGen比MC的层次要高,MCRegisterInfo的信息是不足够的,因此...
Emscripten 1.37.21 发布,LLVM 转 JavaScript 编译器... Emscripten 是 Mozilla 的开发人员 Alon Zakai 所开发的一个独特 LLVM 后端,可以将 LLVM 中间码编译成 JavaScrip...