[MLton] SSA vs SSA2

Matthew Fluet fluet@cs.cornell.edu
Sun, 20 Nov 2005 19:28:59 -0500 (EST)


[Moving from MLton-user to MLton]

>> I'd vote for SSA, since it is a slightly simpler intermediate language,
>> though there has been some argument for migrating all the optimizations
>> from SSA to SSA2 and then eliminating SSA.
>
> I don't think there is a significant difference in complexity between
> SSA and SSA2.

I agree that the difference isn't significant, but the advantage of SSA 
over SSA2 is that the default is immutability.  And most optimizations, 
like loop-invariant code motion, are only sound for immutable 
types/values.  It's relatively easy to check for Ref/Array prims and 
ref/array types in SSA, while in SSA2, any possible component could be 
mutable.  (Witness the recent shrinker bug.)