Low Level Virtual Machine
From Free net encyclopedia
Low Level Virtual Machine, generally known as LLVM, is a compiler infrastructure designed for compile-time, link-time, run-time, and "idle-time" optimization of programs written in arbitrary programming languages.
Using LLVM, one can create a virtual machine for languages like Java, a code generator for a specific machine architecture and optimizers independent from particular platforms or languages. LLVM is language and architecture independent; it lies between a language-specific module and a code generator for a machine. LLVM includes aggressive interprocedural optimization support, static and JIT compilers, and has many components in various stages of development (including Java bytecode and MSIL frontends, a Python frontend, a new graph coloring register allocator, and more).
It currently supports the compilation of C and [[C++]] programs, using front-ends derived from version 3.4 of the GNU Compiler Collection (GCC). LLVM is written in C++ and has been in development since 2000 at the University of Illinois. It is publicly available under the University of Illinois Open Source License [1], an OSI-approved license that is very similar to the BSD license.
Code representation
LLVM supports a language-independent instruction set and type system. Most of instructions have a form similar to three address code. Each instruction is also a static single assignment form, meaning each variable (called a typed register) is assigned once and is frozen for the rest of life; this helps simplify the analysis of the dependency among variables.
Any form of type conversion, from coercion to the downcasting of an object, must be explicit and can be done by cast
instruction. The program without casts, thus, can be considered to be type-safe. LLVM has basic types like integers of fixed sizes and exactly four derived types, namely, pointers, arrays, structures and functions. A type construct in a concrete language can be represented by combining these types in LLVM. For example, a class in C++ can be represented by the combination of structures, functions and arrays of function pointers.
External links
- The LLVM Compiler Infrastructure Project
- LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation - a published paper by Chris Lattner and Vikram Adve.