Skip to main content

Module optimizer

Module optimizer 

Source
Expand description

Peephole optimizer – runs on Stack IR before emission.

Scans for short sequences of stack operations that can be replaced with fewer or cheaper opcodes. Applies rules iteratively until a fixed point is reached. Mirrors the TypeScript peephole optimizer.

Functions§

optimize_stack_ops
Apply peephole optimization to a list of stack ops.