LLVM

LLVM is designed around a language-independent intermediate representation (IR) that serves as a portable, high-level assembly language that can be optimized with a variety of transformations over multiple passes.

Originally implemented for C and C++, the language-agnostic design of LLVM has since spawned a wide variety of frontends: languages with compilers that use LLVM (or which do not directly use LLVM but can generate compiled programs as LLVM IR) include ActionScript, Ada, C# for .NET,[8][9][10] Common Lisp,[11] PicoLisp, Crystal, CUDA, D,[12] Delphi,[13] Dylan, Forth,[14] Fortran,[15] FreeBASIC, Free Pascal, Halide, Haskell, Idris,[16] Jai (only for optimized release builds), Java bytecode, Julia, Kotlin, LabVIEW's G language,[17][18] Objective-C, OpenCL,[19] PostgreSQL's SQL and PLpgSQL,[20] Ruby,[21] Rust,[22] Scala,[23][24] Standard ML,[25] Swift, Xojo, and Zig.

The LLVM project started in 2000 at the University of Illinois at Urbana–Champaign, under the direction of Vikram Adve and Chris Lattner.

[32] "For designing and implementing LLVM", the Association for Computing Machinery presented Vikram Adve, Chris Lattner, and Evan Cheng with the 2012 ACM Software System Award.

[38] Graphics code within the OpenGL stack can be left in intermediate representation and then compiled when run on the target machine.

On systems with high-end graphics processing units (GPUs), the resulting code remains quite thin, passing the instructions on to the GPU with minimal changes.

A similar system was developed under the Gallium3D LLVMpipe, and incorporated into the GNOME shell to allow it to run without a proper 3D hardware driver loaded.

The modifications generally involve a GIMPLE-to-LLVM IR step so that LLVM optimizers and codegen can be used instead of GCC's GIMPLE system.

supports compiling of Ada, C, C++, D, Delphi, Fortran, Haskell, Julia, Objective-C, Rust, and Swift using various frontends.

[citation needed] The core of LLVM is the intermediate representation (IR), a low-level programming language similar to assembly.

Examples of target dependence beyond what is explicitly mentioned in the documentation can be found in a 2011 proposal for "wordcode", a fully target-independent variant of LLVM IR intended for online distribution.

In the past, LLVM also supported other backends, fully or partially, including C backend, Cell SPU, mblaze (MicroBlaze),[57] AMD R600, DEC/Compaq Alpha (Alpha AXP)[58] and Nios2,[59] but that hardware is mostly obsolete, and LLVM developers decided the support and maintenance costs were no longer justified.

[citation needed] LLVM also supports WebAssembly as a target, enabling compiled programs to execute in WebAssembly-enabled environments such as Google Chrome / Chromium, Firefox, Microsoft Edge, Apple Safari or WAVM.

LLVM-compliant WebAssembly compilers typically support mostly unmodified source code written in C, C++, D, Rust, Nim, Kotlin and several other languages.

For some targets, including the various MIPS instruction sets, integrated assembly support is usable but still in the beta stage.

[citation needed] Unlike the GNU linkers, lld has built-in support for link-time optimization (LTO).

This allows for faster code generation as it bypasses the use of a linker plugin, but on the other hand prohibits interoperability with other flavors of LTO.

[64] llvm-libc is an incomplete, upcoming, ABI independent C standard library designed by and for the LLVM project.

This is officially recognized by LLVM's documentation, which suggests against using version numbers in feature checks for this reason.

LLVM IR is used e.g., by radeonsi and by llvmpipe. Both are part of Mesa 3D .