public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Daniel Berlin <dan@cgsoftware.com>
To: Mark Mitchell <mark@codesourcery.com>
Cc: Daniel Berlin <dan@cgsoftware.com>, "gcc@gcc.gnu.org" <gcc@gcc.gnu.org>
Subject: Re: Inlining heuristics for C++
Date: Tue, 10 Jul 2001 00:09:00 -0000	[thread overview]
Message-ID: <87n16dl0ps.fsf@cgsoftware.com> (raw)
In-Reply-To: <398850000.994745191@warlock.codesourcery.com>

Mark Mitchell <mark@codesourcery.com> writes:

> --On Monday, July 09, 2001 09:46:59 PM -0400 Daniel Berlin
> <dan@cgsoftware.com> wrote:
> 
>> Right now, they are horrific.
> 
> Hey, thanks a lot. :-)  They are, actually, the same ones we had in
> the RTL inliner, just about -- except that we can inline so much more!
> 
> I think your ideas are reasonable.  Nathan Sidwell has been thinking
> about these issues, too; you should coordinate with him to try to
> get some decent ideas and some decent measurements.
> 
> One long-term challenge is that we would like to inline when somehow
> that allows major simplifications.  For example, if there is a giant
> function involving tons of calcuation, but we know that the argument
> is `3', and that means we can fold all the calculations, then we
> should do the inlining, even if the inlined function is nominally
> giant.  I have no idea how to do this, though.  It's probably not worth
> bothering about.

This is procedure cloning.
The cheap way is to clone the procedure (with whatever arguments are
constant now omitted from the call), optimize it, see if it
helped relative to the original procedure, if so, change the cloned
name, and the call to match the new cloned name/arguments.

If we find somewhere else compatible with the new arguments, reuse the
cloned procedures.
Picking which procedures to clone is tricky.

See "Aggressive inlining" (Ayers, Gottlieb, Schooler) for more details
(They are HP compiler people, the paper goes into stats about how much
procedure cloning alone vs inlining alone vs both combined helps).
--Dan
> 
> -- 
> Mark Mitchell                mark@codesourcery.com
> CodeSourcery, LLC            http://www.codesourcery.com

-- 
"Is it weird in here, or is it just me?
"-Steven Wright

  parent reply	other threads:[~2001-07-10  0:09 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-07-09 18:47 Daniel Berlin
2001-07-09 19:22 ` Fergus Henderson
2001-07-09 20:18   ` Daniel Berlin
2001-07-09 23:30   ` Mark Mitchell
2001-07-09 19:56 ` Carlo Wood
2001-07-09 20:31   ` Daniel Berlin
2001-07-09 21:05     ` Carlo Wood
2001-07-09 21:26       ` Daniel Berlin
2001-07-09 21:45         ` Carlo Wood
2001-07-09 20:05 ` Timothy J. Wood
2001-07-09 20:34   ` Daniel Berlin
2001-07-09 23:26 ` Mark Mitchell
2001-07-09 23:37   ` Daniel Jacobowitz
2001-07-10  0:00   ` Fergus Henderson
2001-07-10  0:13     ` Daniel Berlin
2001-07-10  0:09   ` Daniel Berlin [this message]
2001-07-10  0:20   ` Daniel Berlin
2001-07-10  0:30   ` Daniel Berlin
2001-07-10  2:47   ` Nathan Sidwell
2001-07-09 20:13 dewar
2001-07-09 20:23 ` Joe Buck
2001-07-09 21:49 dewar
2001-07-09 22:17 ` Daniel Berlin
     [not found] <87r8vpo8rw.fsf@cgsoftware.com.suse.lists.egcs>
     [not found] ` <20010710122244.A14584@hg.cs.mu.oz.au.suse.lists.egcs>
2001-07-10  2:42   ` Andi Kleen
2001-07-10 14:16     ` Hartmut Schirmer
2001-07-11 14:27       ` Fergus Henderson
2001-07-10 14:53 mike stump
2001-07-10 15:04 ` Daniel Berlin

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=87n16dl0ps.fsf@cgsoftware.com \
    --to=dan@cgsoftware.com \
    --cc=gcc@gcc.gnu.org \
    --cc=mark@codesourcery.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).