ARM moves to open source LLVM for future compilers
1 min read
ARM's future compilers will be built on the LLVM open source framework, the company announced yesterday.
The next version, ARM Compiler 6, will be integrated into future versions of the DS-5 development suite. It will first be released for 64bit ARM v8 architecture cores, with 64bit ARM v8 support expected later this year. Full support for ARM v7A, v7R, and initial support for v7M cores, will also be made available.
ARM says the modular nature of LLVM will make collaboration on custom features easier. "The main benefit for users is greater feature velocity from open source," noted Hobson Bullman, general manager of development solutions.
The compiler in the ARM Compiler 6 toolchain is armclang, based on Clang, a C/C++ front end for the LLVM code-generation framework. LLVM is designed as a set of reusable libraries with well defined interfaces. In comparison, armcc, the compiler in ARM Compiler 5, is composed of modules with less well defined interfaces and separation, which makes the parts less reusable across a larger code generation problem space.
armclang adheres to the three phase LLVM design, with a front end parser and syntax checker, a mid end optimiser and code generators that produce native machine code in the backend. The three phases have clear separation in terms of their intended function and this aspect of LLVM makes it reusable and flexible.
The LLVM framework also makes it easier to add new targets. Users have the option of adding their own backends for custom DSPs or GPUs as plugins into the toolchain.
The code generator itself is based on several built-in passes for common problems like instruction selection, register allocation and scheduling, so adding new code generators from scratch is relatively easy.
ARM Compiler 6 comes with optimised libraries and armlink, an industrial strength linker developed as part of the ARM Compiler toolchain.
ARM expects to introduce link time optimisation in a future version of the product. This, it says, would enable optimisation across library boundaries, something which was not possible using older versions of ARM Compiler.