[mercury-users] Optimisation of functions and field updates

Michael Day mikeday at bigpond.net.au
Mon Aug 7 17:44:58 AEST 2006


Hi,

Say I have the following code:

	X = f1(f2(f3(f4(X0))))

where

	f1(X) = X ^ field1 := blah.
	f2(X) = X ^ field2 := blah.
	...

If the functions were inlined, then the multiple field updates could be
combined into a single update, but it appears that this is not happening,
as I get a speed boost when I replaced the function calls with explicit
field updates, even at -O5.

Is there some reason why these functions will not be inlined, or why the
multiple field updates will not be recognised and combined after inlining?

Michael

-- 
Print XML with Prince!
http://www.princexml.com
--------------------------------------------------------------------------
mercury-users mailing list
Post messages to:       mercury-users at csse.unimelb.edu.au
Administrative Queries: owner-mercury-users at csse.unimelb.edu.au
Subscriptions:          mercury-users-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the users mailing list