LLVM is a versatile software infrastructure for compiling and linking programs at different stages of their execution. It provides efficient code generation and optimization for a wide range of programming languages, and supports various platforms and architectures.
One of the most significant advantages of LLVM is its compilation strategy, which enables effective optimization throughout the entire lifetime of a program. LLVM optimizes the program during compile-time, link-time (especially interprocedural optimization), run-time, and offline. Importantly, it remains transparent to developers and maintains compatibility with existing build scripts.
LLVM also uses a virtual instruction set, which is a low-level object code representation that contains simple RISC-like instructions, rich, language-independent type information, and dataflow (SSA) information about operands. This allows for sophisticated transformations on object code, while remaining lightweight enough to attach to the executable. This combination is key to allowing link-time, run-time, and offline transformations.
Furthermore, LLVM is a compiler infrastructure that includes a wide variety of source code that implements the language and compilation strategy. The most critical components of the LLVM infrastructure include a GCC-based C & C++ front-end, a link-time optimization framework with a continuously growing set of global and interprocedural analyses and transformations, static back-ends for the X86, PowerPC, IA-64, Alpha, & SPARC V9 architectures, a back-end that emits portable C code, and a Just-In-Time compiler for X86, PowerPC, and SPARC V9 processors.
Notably, LLVM does not imply things that you would expect from a high-level virtual machine. It does not require garbage collection or run-time code generation. In fact, LLVM is an excellent choice as a static compiler, but optional components can be used to build high-level virtual machines and other systems that require these services. Overall, LLVM is a robust system particularly well-suited for developing new mid-level language-independent analyses and optimizations of all sorts, including those that require extensive interprocedural analysis.
Finally, LLVM is a superb target for front-end development for conventional or research programming languages, including those that required compile-time, link-time, or run-time optimization for effective implementation or proper tail calls, or garbage collection. There is an incomplete list of projects that have used LLVM for various purposes, showing that one can get up-and-running quickly with LLVM, giving them the time to do interesting things, even if someone only has a semester in a university course. Additionally, there is also a list of ideas for projects in LLVM, which is perfect for someone who is interested in exploring LLVM's extensive capabilities.
Version 2.6: N/A