The LLVM intermediate representation
The LLVM intermediate representation (IR) is a low-level assembly-like programming language. LLVM frontends convert input into LLVM IR, which is then converted into the target instruction set by the backend. LLVM IR is available in three formats:
- a human-readable assembly format, which we shall deal first
- an in-memory format suitable for frontends, which we are likely to encounter when writing code in LLVM, and
- a dense bitcode format for serialization, into which the human-readable assembly format is easily converted.
For the introduction to LLVM IR, we will follow Modern Intermediate Representations (IR) by David Chisnall presented at the HPC summer school 2017. For more information on particular types, intrinsics, and special instructions, please see the LLVM Language Reference Manual.
Author: Vedran Miletić