[MLton] case of the "2"'s

Stephen Weeks MLton@mlton.org
Wed, 25 Aug 2004 11:12:02 -0700


> I was wondering what the differences are between the various passes
> in SSA and their "2" versions?

Ssa2 is the new and improved version of Ssa.  The plan is to
eventually replace all of the passes that currently operate on Ssa
with a similar pass operating on Ssa2.  This will take some time.  To
ease the transition, all of the Ssa2 passes run after all of the Ssa
passes, and there is a conversion pass from Ssa to Ssa2.  That way, we
can take one pass at a time from the back of the Ssa simplifier
pipeline, port the pass to Ssa2, and move it to the front of the Ssa2
simplifier pipeline.

As to the difference between the Ssa and Ssa2 languages, the idea is
that Ssa2 allows strictly more optimizations to be expressed than Ssa.
In particular, it is able to express the flattening optimizations that
I've put in over the last few months.  This is achieved by

* allowing tuple fields to be mutable
* making the array/vector type constructor n-ary instead of unary
* expressing constructor selects explicitly

Have a look at the differences between ssa-tree.sig and ssa-tree2.sig
and the CVS log for ssa-tree2.sig for details.  Feel free to ask more
detailed questions if you don't understand something.