The New Features Of LLVM 4.0 & Clang 4.0
Written by Michael Larabel in LLVM on 26 February 2017 at 08:22 AM EST. Add A Comment
LLVM/Clang 4.0 are running a few days behind schedule but should be released in the very near future. With that said, here's our usual look at the new features of this next compiler infrastructure and C/C++ compiler front-end updates.

LLVM/Clang 4.0 is a big version bump even though it's just been another six month cycle for the project. Beginning with 4.0, they are moving to a new versioning scheme where they will be bumping the major version number each time, so the next feature update will be LLVM/Clang 5.0. New changes to LLVM 4.0 include:

- The GVNHoist pass is enabled by default, which is a "new pass based on Global Value Numbering detects similar computations in branch code and replaces multiple instances of the same computation with a unique expression." GVNHoist can benefit code size and generate better schedules, especially for -Os and -Oz modes.

- Experimental support for LLVM coroutines.

- ARM64/AArch64 for LLVM picked up XRay support, refined support for Qualcomm Falkor and Samsung Exynos processors, and various other updates. The 32-bit ARM back-end also picked up a variety of improvements. The LLD linker support for ARM is also much better off.

- The AVR back-end is new to the mainline LLVM code-base.

- FP16 half-precision support for AMDGPU, among other improvements to the AMDGPU back-end.

- Various LLVM API changes.

Changes pertaining to the Clang 4.0 C/C++ compiler front-end include:

- A number of fixes pertaining to the OpenCL C language support, including OpenCL 2.0 fixes. There is also cl_khr_mipmap_image as one of the newly-supported CL extensions.

- Similar to GCC, the -Og optimization level is now supported for optimizing the debugging experience while otherwise being similar to -O1.

- There's also a new -MJ flag for JSON compilation database output to write a compilation database entry per input.

- Improvements to the -flto=thin (ThinkLTO) mode.

- New checks were added to the Clang static analyzer.

Stay tuned for more LLVM/Clang 4.0 benchmarks on Phoronix shortly. More details on the 4.0 changes via the release_40 branches.
Related News
About The Author
Author picture

Michael Larabel is the principal author of and founded the site in 2004 with a focus on enriching the Linux hardware experience. Michael has written more than 20,000 articles covering the state of Linux hardware support, Linux performance, graphics drivers, and other topics. Michael is also the lead developer of the Phoronix Test Suite, Phoromatic, and automated benchmarking software. He can be followed via Twitter or contacted via

Popular News This Week