[mercury-users] accumulator introduction

Michael Day mcda at students.cs.mu.oz.au
Mon Jul 10 20:06:28 AEST 2000


> > Is there any way for Mercury to automatically convert this predicate to
> > use an accumulator, or is it condemned to overflow the detstack forever?
> > 
> It is now in the latest rotd, you need to pass --introduce-accumulators
> and --intermodule-optimization (needed to get the declaration that + is
> associative).

That's very nice, and the performance is comparable to a C for loop. Any
chance of the MLDS optimising simple accumulating functions into an actual
for loop in the future, or is this not how it will work? Is gcc any better
at optimising for loops than hand rolled goto loops?

Michael

--------------------------------------------------------------------------
mercury-users mailing list
post:  mercury-users at cs.mu.oz.au
administrative address: owner-mercury-users at cs.mu.oz.au
unsubscribe: Address: mercury-users-request at cs.mu.oz.au Message: unsubscribe
subscribe:   Address: mercury-users-request at cs.mu.oz.au Message: subscribe
--------------------------------------------------------------------------



More information about the users mailing list