public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: AJM-2 <mcpherson.aj@gmail.com>
To: gcc@gcc.gnu.org
Subject: Re: IPA and LTO
Date: Wed, 13 Jul 2011 16:23:00 -0000	[thread overview]
Message-ID: <32054720.post@talk.nabble.com> (raw)
In-Reply-To: <CAD_=9DQjNChRZJoMe53ckihhAJfefx_DKYWyoxxjZnqemN-a2g@mail.gmail.com>


What you say is in line with my understanding, however when I instrument the
execute function of ipa-function-and-variable-visibility
(local_function_and_variable_visibility()) I note that:

gcc -flto a.c b.c
causes the pass to be called twice (presumably once per file).

If I split the compilation into two stages, then in the link stage
gcc -flto a.o b.o
the pass is never called.

Conversely, the gate of IPA-Points-to does seem to be called three times at
link time (presumably once for each file and then once for all together).  I
cannot discover the cause of the different behaviours here.


Diego Novillo-3 wrote:
> 
> On Wed, Jul 13, 2011 at 10:22, AJM-2 <mcpherson.aj@gmail.com> wrote:
> 
>> My question is whether LTO can be used in this way, to have a simple ipa
>> pass called once at link time with access to the function bodies, and if
>> so
>> how is this achieved?  cgraph_function_body_availability seems to only be
>> half the story.
> 
> Yes, it can.  You seem to be describing what GCC calls "simple IPA
> pass".  These are passes that cannot run in partitioned LTO mode, as
> they require the function bodies to operate.  Look for passes like
> pass_ipa_function_and_variable_visibility for an example of a simple
> IPA pass.
> 
> 
> Diego.
> 
> 

-- 
View this message in context: http://old.nabble.com/IPA-and-LTO-tp32052838p32054720.html
Sent from the gcc - Dev mailing list archive at Nabble.com.

  reply	other threads:[~2011-07-13 15:55 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-13 14:56 AJM-2
2011-07-13 15:55 ` Diego Novillo
2011-07-13 16:23   ` AJM-2 [this message]
2011-07-13 16:35     ` Pierre Vittet
2011-07-13 20:10     ` Richard Guenther
2011-07-13 20:40       ` AJM-2
2011-07-13 22:43         ` Richard Guenther
  -- strict thread matches above, loose matches on Subject: below --
2011-07-13 13:47 AJM-2

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=32054720.post@talk.nabble.com \
    --to=mcpherson.aj@gmail.com \
    --cc=gcc@gcc.gnu.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 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).