LLVM 9.0.0 arrives with major improvements

LLVM compiler infrastructure project delivers optimizations for memory, pattern matching, and C++

LLVM 9.0.0 arrives with major improvements

The LLVM community has released version 9.0.0 of the LLVM Compiler Infrastructure project. The update features optimizations for memory, pattern matching, and C++.

With the new release, LLVM will remove stores to constant memory under the assumption the code in question must be dead. This had proven to be a problem for some C/C++ code bases that expect to be able to cast away const. This has been an undefined behavior that until now had not been actively utilized for optimization purposes in this exact way.

In addition, LLVM now will pattern-match wide scalar values stored by a succession of narrow stores. For example, Clang will compile the following function writing a 32-bit value in big-endian order in a portable manner:

void write32be(unsigned char *dst, uint32_t x) {
  dst[0] = x >> 24;
  dst[1] = x >> 16;
  dst[2] = x >> 8;
  dst[3] = x >> 0;

Also, the LLVM optimizer now will convert calls to memcmp into bcmp in some instances.

Other changes in LLVM 9.0.0 include:

  • Experimental support for C++ for the OpenCL framework.
  • Two new extension points, EP_FullLinkTimeOptimizationEarly and EP_FullLinkTimeOptimizationLast, are available for plug-ins to specialize the legacy pass manager full LTO pipeline.
  • Support for asm goto, enabling, for example, the mainline Linux kernel for x86_64 to build with Clang.
  • The CMake parameter CLANG_ANALYZER_ENABLE_Z3_SOLVER was replaced by LLVM_ENABLE_Z3_SOLVER.
  • LLVM now emits range checks for jump tables when lowering switches with unreachable default destination.
  • The RISCV target has graduated from the “experimental” phase. It is now built by default.
  • The ORCv1 JIT API was deprecated.

One issue that remains with LLVM 9.0.0 results in Clang being miscompiled by GCC 9. This is cited as a known issue with the release.

LLVM supports compilers for the Rust and Swift languages and a toolkit for building new languages. One possible area of growth for LLVM is machine learning, with the MLIR (Multi-Level Intermediate Representation) machine learning compiler infrastructure having just been contributed to the LLVM Foundation. MLIR was created by the developers of the TensorFlow machine learning library.

Where to download LLVM 9.0.0

You can download LLVM 9.0.0 from llvm.org

Copyright © 2019 IDG Communications, Inc.