Skip to main content

Module loop_analysis

Module loop_analysis 

Source
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§

InductionVar
An induction variable: a local or module binding that follows the pattern var = var + step each iteration.
LoopInfo
Information about a single loop in the bytecode.

Functions§

analyze_loops
Analyze all loops in a bytecode program.