Expand description
Rewrite-rule-driven simplification of MirScalarExpr.
reduce repeatedly applies a fixed set of local rewrite rules to an
expression until reaching a fixed point. The per-variant rules live in
sibling modules (unary, binary, variadic, if_then); this file
owns the fixed-point loop and the pre/post-pass dispatch.
Behavioral parity with the prior imperative implementation is a goal: rule order and the pre-/post-pass split are preserved.
Modulesยง
- binary ๐
- Post-order rewrites for
CallBinarynodes. - if_then ๐
- Post-order rewrites for
Ifnodes. - unary ๐
- Post-order rewrites for
CallUnarynodes. - variadic ๐
- Post-order rewrites for
CallVariadicnodes.
Functionsยง
- reduce
- Reduce
exprto a simpler equivalent form by repeatedly applying local rewrite rules until reaching a fixed point. - reduce_
post ๐ - Post-order rewrites, applied after children have been reduced.
- reduce_
pre ๐ - Pre-order rewrites, applied before children are visited.