[m-dev.] Loop flattening and LCPS optimization

Fergus Henderson fjh at cs.mu.OZ.AU
Tue Apr 24 03:34:55 AEST 2001


On 23-Apr-2001, Ralph Becket <rbeck at microsoft.com> wrote:
> Wargh!  I write a lot of code that assumes that loop-invariants get
> lifted out.
> 
> Before I fret, you are saying that with
> 
> f(X) = (if X = g(123) then done(X) else f(succ(X))).
> 
> the compiled code will currently evaluate g(123) on every loop
> iteration?

Yes.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
                                    |  of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh>  |     -- the last words of T. S. Garp.
--------------------------------------------------------------------------
mercury-developers mailing list
Post messages to:       mercury-developers at cs.mu.oz.au
Administrative Queries: owner-mercury-developers at cs.mu.oz.au
Subscriptions:          mercury-developers-request at cs.mu.oz.au
--------------------------------------------------------------------------



More information about the developers mailing list