public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* ipa on all files together
@ 2010-11-01 23:57 Hongtao
  2010-11-02  0:35 ` Diego Novillo
  0 siblings, 1 reply; 4+ messages in thread
From: Hongtao @ 2010-11-01 23:57 UTC (permalink / raw)
  To: gcc

 Hi All,

While using gcc-4.6 with option -flto, I found that interprocedural
analysis were performed on each source file separately. For example for
the pass pass_ipa_pta, if we compile two files like :
         gcc -O -flto f1.c f2.c
we have the pass run twice, one for each source file. So is there a way
that can perform IPA on all source files together?


Thanks,
Hongtao
Purdue University

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ipa on all files together
  2010-11-01 23:57 ipa on all files together Hongtao
@ 2010-11-02  0:35 ` Diego Novillo
  2010-11-02  0:40   ` Hongtao
  0 siblings, 1 reply; 4+ messages in thread
From: Diego Novillo @ 2010-11-02  0:35 UTC (permalink / raw)
  To: Hongtao; +Cc: gcc

On Mon, Nov 1, 2010 at 19:57, Hongtao <yu171@purdue.edu> wrote:
>  Hi All,
>
> While using gcc-4.6 with option -flto, I found that interprocedural
> analysis were performed on each source file separately. For example for
> the pass pass_ipa_pta, if we compile two files like :
>         gcc -O -flto f1.c f2.c
> we have the pass run twice, one for each source file. So is there a way
> that can perform IPA on all source files together?

With -combine you used to be able to do this, but it has been removed
in favour of -flto (actually, I'm not quite sure whether it's been
removed already, but it's on the chopping block).

With -flto, IPA will be performed on all the files together, as well
as each file separately.  In your example, IPA runs 3 times.  Once for
each f1.c and f2.c, and a third time with both f1.o and f2.o as a
single translation unit.


Diego.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ipa on all files together
  2010-11-02  0:35 ` Diego Novillo
@ 2010-11-02  0:40   ` Hongtao
  2010-11-02 10:49     ` Richard Guenther
  0 siblings, 1 reply; 4+ messages in thread
From: Hongtao @ 2010-11-02  0:40 UTC (permalink / raw)
  To: Diego Novillo; +Cc: gcc

 On 11/01/10 20:35, Diego Novillo wrote:
> On Mon, Nov 1, 2010 at 19:57, Hongtao <yu171@purdue.edu> wrote:
>>  Hi All,
>>
>> While using gcc-4.6 with option -flto, I found that interprocedural
>> analysis were performed on each source file separately. For example for
>> the pass pass_ipa_pta, if we compile two files like :
>>         gcc -O -flto f1.c f2.c
>> we have the pass run twice, one for each source file. So is there a way
>> that can perform IPA on all source files together?
> With -combine you used to be able to do this, but it has been removed
> in favour of -flto (actually, I'm not quite sure whether it's been
> removed already, but it's on the chopping block).
>
> With -flto, IPA will be performed on all the files together, as well
> as each file separately.  In your example, IPA runs 3 times.  Once for
> each f1.c and f2.c, and a third time with both f1.o and f2.o as a
> single translation unit. 
  Thanks. But can I only keep the third pass, i.e.  I want to perform a
pass only on all units together without on each unit separately?

  Hongtao

> Diego.
>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ipa on all files together
  2010-11-02  0:40   ` Hongtao
@ 2010-11-02 10:49     ` Richard Guenther
  0 siblings, 0 replies; 4+ messages in thread
From: Richard Guenther @ 2010-11-02 10:49 UTC (permalink / raw)
  To: Hongtao; +Cc: Diego Novillo, gcc

On Tue, Nov 2, 2010 at 1:40 AM, Hongtao <yu171@purdue.edu> wrote:
>  On 11/01/10 20:35, Diego Novillo wrote:
>> On Mon, Nov 1, 2010 at 19:57, Hongtao <yu171@purdue.edu> wrote:
>>>  Hi All,
>>>
>>> While using gcc-4.6 with option -flto, I found that interprocedural
>>> analysis were performed on each source file separately. For example for
>>> the pass pass_ipa_pta, if we compile two files like :
>>>         gcc -O -flto f1.c f2.c
>>> we have the pass run twice, one for each source file. So is there a way
>>> that can perform IPA on all source files together?
>> With -combine you used to be able to do this, but it has been removed
>> in favour of -flto (actually, I'm not quite sure whether it's been
>> removed already, but it's on the chopping block).
>>
>> With -flto, IPA will be performed on all the files together, as well
>> as each file separately.  In your example, IPA runs 3 times.  Once for
>> each f1.c and f2.c, and a third time with both f1.o and f2.o as a
>> single translation unit.
>  Thanks. But can I only keep the third pass, i.e.  I want to perform a
> pass only on all units together without on each unit separately?

If -flto-slim support gets merged then yes.

Richard.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2010-11-02 10:49 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-01 23:57 ipa on all files together Hongtao
2010-11-02  0:35 ` Diego Novillo
2010-11-02  0:40   ` Hongtao
2010-11-02 10:49     ` Richard Guenther

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).