This paper describes LLVM (Low Level Virtual Machine),a compiler framework designed to supporttransparent,lifelong program analysis and transformation for arbitrary programs,by providing high-level information to compiler transformationsat compile-time, link-time, run-time, and in idle time between runs.LLVM defines acommon, low-level code representation in Static Single Assignment (SSA)form, with several novel features:a simple,language-independent type-system that exposes theprimitives 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 handlingfeatures of high-level languages (andsetjmp/longjmp in C) uniformly andefficiently. The LLVM compiler framework and code representation togetherprovide 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 typeinformation it provides;(b) compiler performance for several interprocedural problems; and(c) illustrative examples of the benefits LLVM provides for severalchallenging compiler problems.
Note this paper supersedes theearlier tech report.
"LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation", Chris Lattner and Vikram Adve.
Proceedings of the 2004 International Symposium onCode Generation and Optimization (CGO'04), Palo Alto, California, Mar. 2004.
@InProceedings{LLVM:CGO04, author = {Chris Lattner and Vikram Adve}, title = "{LLVM: A Compilation Framework for Lifelong Program Analysis \& Transformation}", booktitle = "{Proceedings of the 2004 International Symposium on Code Generation and Optimization (CGO'04)}", address = {Palo Alto, California}, month = {Mar}, year = {2004} }