SSA IL

Matthew Fluet Matthew Fluet <fluet@CS.Cornell.EDU>
Thu, 1 Nov 2001 15:53:46 -0500 (EST)


I checked in a version of localFlatten for SSA.

I don't know if this should be considered a bug, but I've been able to
generate CPS programs that type-check, translate into SSA, but don't pass
the initial type-check in the SSA simplify.fun (the dominator analysis for
check-scopes fails with "graph not connected").  Lot's of the regressions
fail like this when compiled with:

mlton -drop-pass raiseToJump2CPS -drop-pass contify3CPS 
      -drop-pass unusedArgs2CPS -drop-pass introduceLoopsCPS 
      -drop-pass localFlatten3CPS -drop-pass commonSubexpCPS 
      -drop-pass commonBlockCPS -drop-pass unusedArgs3CPS 
      -drop-pass removeUnused4CPS

Some of them also fail with "Raise must have one var".

I can also get redundantTestsCPS to fail with "graph not connected" when
it tries computing the dominator tree if I drop enough passes before it.


I've made sure that all of the SSA simplification passes "work" on the
regressions and self-compile when all of the CPS passes are on.  I can
even pass most of the regression tests when I drop all passes except
constantPropagation (to implement Array_array0) and polyEqual (to
implement MLton_equal) -- some have an "unhandled exception: Option"
during compilation; some have the "graph not connected"; and a segFault on
exnHistory2; various other run-time errors.

There is a hack in the SSA simplifier that runs removeUnused between every
pass as a "poor-man's shrinker".  Really, I just need somthing to clean up
unreachable roots in the call graphs so that the the dominators can be
computed.  Unfortunately, removeUnused has the side effect of inserting
lots of "wrapper" blocks that should be eliminated by the real shrinker. 
So, the resulting programs just get bigger and bigger.  The x86-codegen
should get rid of most of these extraneous gotos, but they're hanging
around.