LLVM: A Compilation Framework for
Lifelong Program Analysis & Transformation
Chris Lattner and Vikram Adve


This paper describes LLVM (Low Level Virtual Machine), a compiler framework designed to support transparent, lifelong program analysis and transformation for arbitrary programs, by providing high-level information to compiler transformations at compile-time, link-time, run-time, and offline. LLVM defines a common, low-level code representation in Static Single Assignment (SSA) form, with several novel features: a simple, language-independent type-system that exposes the primitives commonly used to implement high-level language features; an instruction for typed address arithmetic; and a simple mechanism that can be used to implement the exception handling features of high-level languages (and setjmp/longjmp in C) uniformly and efficiently. The LLVM compiler framework and code representation together provide a combination of key capabilities that are important for practical, lifelong analysis and transformation of programs. To our knowledge, no existing compilation approach provides all these capabilities. We describe the design of the LLVM representation and compiler framework, and evaluate the design in three ways: (a) the size and effectiveness of the representation, including the type information it provides; (b) compiler performance for several interprocedural problems; and (c) illustrative examples of the benefits LLVM provides for several challenging compiler problems.


"LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation", Chris Lattner & Vikram Adve
Technical Report #UIUCDCS-R-2003-2380, Computer Science Dept., Univ. of Illinois, Sep. 2003.

This paper is an early version of the paper published in CGO'04, and is superseded by it.


BibTeX Entry:

    Author      = {Chris Lattner and Vikram Adve},
    Title       = "{LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation}",
    Institution = "{Computer Science Dept., Univ. of Illinois at Urbana-Champaign}",
    Number      = {UIUCDCS-R-2003-2380},
    Type        = {Tech. Report},
    Month       = {Sep},
    Year        = {2003}