[MLton-devel] Re: PRE in MLton

Stephen Weeks MLton@mlton.org
Tue, 15 Apr 2003 16:02:29 -0700


Henry:
> Isn't  the  transformation  to  handle  the  while vs. do-while simply one of
> unrolling recursive functions once.  I.e., all uses of f (except those in the
> body  of f) are replaced with calls to f'.  The definition of f' is identical
> to the definition of f.

Tom:
> Better is to move the test at the beginning of the loop to both the
> beginning and end:

Loop unrolling and moving tests are two optimizations that may
sometimes insert pre headers, but won't do so in general.  Also, you
also have to be careful in SSA form with duplicating code, since it
may violate SSA invariants.

I think loop preheader insertion is an easier way to go and gives just
enough of what you need (and nothing more).


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
MLton-devel mailing list
MLton-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mlton-devel