[mercury-users] foreign_decl vs. foreign_code
Fergus Henderson
fjh at cs.mu.OZ.AU
Wed Feb 13 15:12:32 AEDT 2002
On 13-Feb-2002, Michael Day <mikeday at bigpond.net.au> wrote:
>
> I am using -O5 --intermodule-optimization
> --trans-intermod-opt --constraint-propagation, are there any other
> interesting optimizations I could try that are not enabled by default with
> -O5 or -O6?
You could try compiling without `--constraint-propagation'; the reason that
isn't enabled by default is that sometimes it slows things down.
If your program is small, you will probably get better performance by
adding `--inline-alloc' to MGNUCFLAGS.
If your program is large, you might get better performance by adding
`--opt-space' to MCFLAGS.
For the hlc.gc grade, you might get better performance by using a more
recent version of gcc, e.g. gcc 3.0. (However the asm_fast.gc grade
doesn't work with gcc 3.0, so keep a copy of gcc 2.95.* around too.)
For the hlc.gc grade, you can also get slightly better performance by
defining MR_USE_REGPARM. This enables some stuff which tells gcc to use
a more efficient calling convention that passes parameters in registers.
But this requires gcc >= 3.0, and you also you need to rebuild the Mercury
runtime and standard library with MR_USE_REGPARM defined.
For the hlc.gc grade, or if your program makes use of the C interface,
you could also try adding `-O3' to CFLAGS. It hasn't helped in the
benchmarks that I've tried, but you never know ;-)
--
Fergus Henderson <fjh at cs.mu.oz.au> | "I have always known that the pursuit
The University of Melbourne | of excellence is a lethal habit"
WWW: <http://www.cs.mu.oz.au/~fjh> | -- the last words of T. S. Garp.
--------------------------------------------------------------------------
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