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.