You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Canonicalize IR to disallow throwing GlobalRef in value position (#36450)
In anticipation of making the SSA IR more of an interface
that packages can use to implement custom compiler transformation,
I'd like to do some cleanup first. The is the first of the items
on my list: Disallowing GlobalRef in value position if it could
potentially throw (because the binding doesn't exist yet).
This is done as part of SSA conversion, because we don't know
whether a binding will exist during parsing/lowering and we
don't modify the IR at all between lowering and the end of
type inference, so doing it during SSA conversion is the first
possible opportunity.
The reason to do this is to simplify transformation passes that
want to replace calls with sequences of other instructions. By
moving those GlobalRef that could potentially throw into statement
position, the order of argument evaluation does not matter (this
isn't quite true yet due to static parameters, but I'd like to
fix that in a separate commit). I think that's a desirable property
to simplify the life os pass authors.
0 commit comments