Hasty Briefsbeta

Bilingual

What I talk about when I talk about IRs

a year ago
  • #intermediate-representation
  • #compiler-design
  • #optimization
  • Compiler intermediate representations (IRs) should allow decisions based on local information.
  • Control-flow constructs like loops and conditionals are decomposed into simpler comparisons and jumps in IRs.
  • Explicit jumps and labels transform code into a control-flow graph (CFG), enabling more flexible optimizations.
  • Basic blocks and extended basic blocks (EBBs) are key components in CFGs, with differing opinions on their merits.
  • Abstract interpretation on graphs allows for advanced optimizations.
  • Stack-based IRs use implicit shared state (the stack), while register-based IRs use explicit named inputs and outputs.
  • Static single assignment (SSA) ensures each variable is defined once, simplifying analysis and optimization.
  • Static single information (SSI) form refines SSA by encoding metadata about variables, enabling more precise analysis.
  • Sea of nodes (SoN) IR design reifies both data and control dependencies, allowing for more flexible instruction ordering.
  • Other related IR designs include value dependence graphs (VDG), value state dependence graphs (VSDG), and program dependence graphs (PDG).