Add reduce-ir-children; rebuild the read-only IR walks on it

map-ir-children single-sourced the child layout for rewrite passes; the read-only
analyses each re-enumerated ops by hand. Add a fold companion, reduce-ir-children,
and rebuild body-size, pure?, and body-closed? on it (each reduces to a leaf value
+ the special ops it actually needs). local-escapes? stays an explicit walk — its
default is conservatively true and it inspects node shape beyond child purity, so
folding an unhandled op over its children would be unsound for scalar replacement.
This commit is contained in:
Yogthos 2026-06-23 01:28:32 -04:00
parent adf00a3b51
commit 524d4cd8d1
3 changed files with 247 additions and 241 deletions

File diff suppressed because one or more lines are too long