All of lore.kernel.org
 help / color / mirror / Atom feed
From: Timothy Miller <miller@techsource.com>
To: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: -O3.... again
Date: Tue, 16 Mar 2004 11:32:09 -0500	[thread overview]
Message-ID: <40572C09.5080208@techsource.com> (raw)

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.


             reply	other threads:[~2004-03-16 16:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-16 16:32 Timothy Miller [this message]
2004-03-16 16:38 ` -O3.... again Michael Buesch

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=40572C09.5080208@techsource.com \
    --to=miller@techsource.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.