[m-dev.] for review: make tailcall loops an MLDS transformation

Fergus Henderson fjh at cs.mu.OZ.AU
Thu Aug 24 16:03:26 AEST 2000


On 23-Aug-2000, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> On 22-Aug-2000, Fergus Henderson <fjh at cs.mu.OZ.AU> wrote:
> > On 22-Aug-2000, Tyson Dowd <trd at cs.mu.OZ.AU> wrote:
> > > Also, we transform into label/goto instead of for/continue.  This is
> > > because IL doesn't have a for/continue construct.  It may be worth
> > > revisiting this decision in future and performing benchmarks.
> > 
> > I think this one is not such a good idea, since Java, which is definitely
> > an important target language, supports for/continue but not label/goto.
> 
> Understood.  But 
> 	(1) we don't have a Java backend
> 	(2) There is no for/continue in MLDS anyway.
> 	    There is a while, but no break (I think you can do it with
> 	    while/break, but it's much uglier than for/continue).

I agree that using `continue' would be much more elegant than using
`break'.  But `continue' works with `while' just as well as it works
with `for'.  If/when we change it to work with a Java back-end,
we should use `while/continue' rather than `while/break' or
`for/continue'.

> So you cannot turn it into anything but label/goto, and since our two
> backend targets currently support label/goto I don't see much
> justification using anything else right now.  When the Java backend is
> written it might be worth adding for/continue to MLDS and doing it that
> way.

OK.

-- 
Fergus Henderson <fjh at cs.mu.oz.au>  |  "I have always known that the pursuit
WWW: <http://www.cs.mu.oz.au/~fjh>  |  of excellence is a lethal habit"
PGP: finger fjh at 128.250.37.3        |     -- 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