Expand description
Loop Analysis for JIT Optimization
Analyzes bytecode loops to identify:
- Loop-invariant locals (for LICM — Loop-Invariant Code Motion)
- Induction variables (for bounds check hoisting and strength reduction)
- Simple loops amenable to unrolling
This analysis runs before code generation and produces LoopInfo structs that the compiler consults during IR emission.
Structs§
- Induction
Var - An induction variable: a local or module binding that follows the pattern
var = var + stepeach iteration. - Loop
Info - Information about a single loop in the bytecode.
Functions§
- analyze_
loops - Analyze all loops in a bytecode program.