inline
Matthew Fluet
fluet@CS.Cornell.EDU
Mon, 5 Nov 2001 20:16:28 -0500 (EST)
> > All I see are statements that happen to have immediate
> > labels in their srcs. To keep things reasonable, I inherit the transfers
> > from Machine IL that indicate the handler for non-tail calls; that way,
> > for CFG traversals, I just need to look at the Transfer.t. The
> > alternative is to walk through all of the statements each time.
>
> OK, if you'd rather not walk the statements, that is fine with me.
> I'll put the necessary hack in implement-handlers to avoid generating
> the useless SetHandlers.
I just have an aversion to generating code for unreachable code. The big
issue is when does that SetHandler become useless. Right now, because the
case in:
L_1078 ()
SetHandler L_1071
case global_60 of
Env_6 => L_1052
| Env_8 => L_1054
| Env_56 => L_1070
| Env_10 => L_1073
| Env_7 => L_1075
| Env_0 => L_1077
at the end of SSA isn't optimized (to L_1077), then it looks like a set
handler is necessary for the non-tail call down L_1070 (although I don't
see why the set handler go hoisted back this far, when the only use of the
handler is at that non-tail call). So, it survives through to
backend.fun, and through to codegen. It doesn't really become useless
until something decides that L_1070 isn't reachable. Since that's
happening in the codegen (right now), it seems that the codegen should
remove the statement; not use the SetHandler as an indication that the
handler is indeed reachable.