* -O3.... again
@ 2004-03-16 16:32 Timothy Miller
2004-03-16 16:38 ` Michael Buesch
0 siblings, 1 reply; 2+ messages in thread
From: Timothy Miller @ 2004-03-16 16:32 UTC (permalink / raw)
To: Linux Kernel Mailing List
I know this has been beat to death, but I was wondering about something,
and google isn't being forthcoming.
I understand that the biggest problem with -O3 is the automatic function
inlining. It tends to make things worse, due to cache misses.
Well, the default maximum for automatic inlining for GCC (--param
max-inline-insns-auto=n) is 300 pseudo instructions, which sounds
awfully high to me (although I don't know what a pseudo instruction
quite corresponds to).
Has anyone tinkered with different values for -finline-limit, or
specifically max-inline-insns-auto to see if they could actually get any
benefit out of it?
It seems to me that as a function grows beyond a certain size, the value
of inlining it diminishes rapidly. Only when the function-call overhead
is a significant part of the over-all run-time of the rest of the
function does it really help to inline. Well, if the kernel isn't
getting benefit from the defaults for -O3, then perhaps the defaults are
wrong and need to be tweaked.
Anyone experiment with this? Any thoughts?
I doubt this would apply well right off to the kernel, but right now,
I'm doing gentoo emerges of GCC with varying CFLAGS settings. First, I
emerge GCC with the experimental values of CFLAGS. Then I change the
CFLAGS to a standard setting and time it (the timed run must always have
the same parameters for the target). My objective is to determine the
MINIMUM value of max-inline-insns-auto which yields an improvement over -O2.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: -O3.... again
2004-03-16 16:32 -O3.... again Timothy Miller
@ 2004-03-16 16:38 ` Michael Buesch
0 siblings, 0 replies; 2+ messages in thread
From: Michael Buesch @ 2004-03-16 16:38 UTC (permalink / raw)
To: Timothy Miller; +Cc: linux kernel mailing list
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Tuesday 16 March 2004 17:32, you wrote:
> Anyone experiment with this? Any thoughts?
Some time ago I experimented with some crazy (tm)
optimization values.
http://marc.theaimsgroup.com/?l=linux-kernel&m=104655063413152&w=2
As you can see -O3 broke ide-scsi for me. I don't know
the reason for it and I don't know if this applies to
recent kernels, too.
So it is possible to break stuff with -O3
- --
Regards Michael Buesch [ http://www.tuxsoft.de.vu ]
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFAVy2rFGK1OIvVOP4RAm9mAJ9zK3OiDsJmUXaaEygxikR034Rv9ACfXlaB
cAQ/IoX7wzxUNaOB+1LtYxE=
=0inF
-----END PGP SIGNATURE-----
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-03-16 16:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-03-16 16:32 -O3.... again Timothy Miller
2004-03-16 16:38 ` Michael Buesch
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.