Expand description
Optimization passes for ternary bytecode.
Provides dead trit elimination, constant folding, trit merging, peephole optimization, loop detection, and a configurable optimization pipeline.
Structs§
- Loop
Info - Information about a detected loop in ternary bytecode.
- Optimization
Pipeline - A configurable pipeline of optimization passes.
- Optimization
Result - Result of an optimization pass.
- Peephole
Optimizer - A peephole optimizer that examines small windows of instructions and replaces them with more efficient patterns.
- Program
- A program is a sequence of instructions.
Enums§
Functions§
- constant_
folding - Evaluates constant expressions at compile time.
- dead_
trit_ elimination - Removes instructions whose results are never used.
- detect_
loops - Detects loops in ternary bytecode by finding back-edges (jumps to earlier positions).
- detect_
loops_ with_ iterations - Detects loops and attempts to estimate iteration count for fixed-count loops.
- trit_
merging - Merges redundant sequences of ternary operations.