SSA

Matthew Fluet Matthew Fluet <fluet@CS.Cornell.EDU>
Tue, 23 Oct 2001 11:42:41 -0400 (EDT)


> I don't see why we need to indicate anything to live -- it has the
> function and can see all the necessary cont-handler pairs.  How about:
> change the frame field of the result of labelLive (in live.sig) to
> 
> 			 frame: (Label.t option * Var.t list) list,

I think this is almost working now.  One final subtlety: each continuation
is given a frame size based on the "high-water mark" on stack slots
allocated.  This is fine for the continuation, but when we use the
dominator tree of the intuitive control-flow graph, we might do allocation
for a cont before all of its paired handlers.  So, when generating the
continuation stub for a cont/handler pair, we really give it a frame size
as the maximum of the size of the "real" continuation and the size of the
paired handler. 

Note, this complicates any future work on avoiding the stub shuffle with
non-tail calls; the "real" continuation's arguments may not be allocated
at the top of the stub's frame.

This also slightly complicates allocate-registers.  When allocating
registers for a continuation, we can't compute all of the operands live in
all the frames, because allocation for some paired handlers might not yet
have occured.  So, we keep a todo list of thunks to "finish" setting the
AllocateRegister.Info.T for continuations after allocating all blocks.  We
don't need to thunk everything, just continuations.

I'm currently trying to track down a bug in prodcons.sml.  Very strange;
only shows up when running the regressions script and seems to be related
to the new removeUnused pass for ssa.