Languages / Knowledge library
Intermediate Representation (IR)
Expresses a program in a form designed for analysis and transformation
Why learn Intermediate Representation (IR)?
It decouples source languages from machine targets and optimization passes
The problem it solves
It provides a stable middle layer for compiler work
Where it came from
Intermediate Representation (IR) is a programming language and runtime concept that expresses a program in a form designed for analysis and transformation. Its guarantees and tradeoffs depend on the concrete implementation and operating context.
Build your understanding
Work through these exercises in order. Try the task before opening a reference.
- Define Intermediate Representation (IR) and distinguish it from a neighboring concept.
- Choose a realistic task where Intermediate Representation (IR) is appropriate.
- Identify a failure mode caused by misusing Intermediate Representation (IR).
- Interpret a small design or result involving Intermediate Representation (IR).
- Explain one tradeoff or limitation of Intermediate Representation (IR).
Documentation and sources
- LLVM Language Reference Manual (llvm.org)