Expand description
Constant folding optimization pass for MIR.
Walks basic blocks and evaluates Rvalue::BinaryOp / Rvalue::UnaryOp
where both operands are Operand::Constant, replacing with Rvalue::Use(Operand::Constant(...)).
Functionsยง
- fold_
constants - Run constant folding on a MIR body. Returns the number of folds applied.