notes

LLVM: A Compilation Framework for Lifelong Program Analysis & Transformation

Chris Lattner and Vikram Adve

Proc. of the 2004 International Symposium on Code Generation and Optimization (CGO’04), Palo Alto, California, Mar. 2004.

https://www.llvm.org/pubs/2004-01-30-CGO-LLVM.html

Abstract

Supports transparent, lifelong program analysis and transformation by providing high-level information to compiler transformations at every stage.

IR:

Paper overview

  1. Size and effectiveness of IR, including type information
  2. Compiler performance for interprocedural problems
  3. Benefits of LLVM for challenging compiler problems

§1 Introduction

Lifelong code analysis and transformation

LLVM IR

Effectiveness criteria:

§2 Program representation

§2.1 Instruction set

§2.2 Language-independent type information

§2.3 Explicit memory allocation and unified memory model

§2.4 Function calls and exception handling

§2.5 Representations

§3 Compiler architecture

§3.1 High-level design

LLVM capabilities (§1)

§3.2 Compile-time

§3.3 Linker and interprocedural optimizer

§3.4 Offline or JIT native code generation

§3.5 Runtime path profiling and reoptimization

§3.6 Offline reoptimization with end-user profile information

Changes since paper

Questions

What is the difference between gated and non-gated phi functions?

Clarify terminology for:

Non-loop transformations are simplified because they do not encounter anti- or output dependencies on registers

Expand upon

Infinite virtual registers vs x86 registers (get list).

There are now separate insts for int/float ops. Pull up RFCs to see why that was changed.

I need to separately cover SSA form because it seems to be assumed.

Update GEP example syntax.