I just tried -fwhole-program. It can achieve extra 3%-4% saving.
That is brilliant. Thanks.

Bingfeng 

> -----Original Message-----
> From: Jan Hubicka [mailto:hubi...@ucw.cz] 
> Sent: 28 April 2010 13:59
> To: Bingfeng Mei
> Subject: Re: LTO question
> 
> > Not yet, I mistakenly thought -fwhole-program is the same as -fwhopr
> > and it is just for solving scaling issue of large program.(These two
> > options do look similar :-). I shall try next.
> 
> Yep, -fwhopr is not ideal name, but I guess there is not much 
> to do about it.
> With -fwhole-program LTO should be a lot more effective.
> 
> Honza
> > 
> > Bingfeng
> > 
> > > -----Original Message-----
> > > From: Jan Hubicka [mailto:hubi...@ucw.cz] 
> > > Sent: 28 April 2010 12:21
> > > To: Bingfeng Mei
> > > Subject: Re: LTO question
> > > 
> > > > Thanks, I will check what I can do with collect2. LTO
> > > > seems to save 6-9% code size for applications I tested
> > > > and should be very useful for us.
> > > Did you also tested with -fwhole-program? :)
> > > 
> > > Honza
> > > > 
> > > > Bingfeng 
> > > > 
> > > > > -----Original Message-----
> > > > > From: Richard Guenther [mailto:richard.guent...@gmail.com] 
> > > > > Sent: 28 April 2010 10:33
> > > > > To: Bingfeng Mei
> > > > > Cc: gcc@gcc.gnu.org
> > > > > Subject: Re: LTO question
> > > > > 
> > > > > On Tue, Apr 27, 2010 at 6:30 PM, Bingfeng Mei 
> > > > > <b...@broadcom.com> wrote:
> > > > > > Hello,
> > > > > > I have been playing with LTO. I notice that LTO doesn't 
> > > work when
> > > > > > object files are achived into static library files 
> and the final
> > > > > > binary is linked against them, although these object files 
> > > > > are compiled
> > > > > > with -flto and I can see all the lto related sections 
> > > in .a files.
> > > > > > Is this what is described in LTO Wiki page?
> > > > > >
> > > > > > "As an added feature, LTO will take advantage of the 
> > > plugin feature
> > > > > > in gold. This allows the compiler to pick up object 
> > > files that may
> > > > > > have been stored in library archives. "
> > > > > >
> > > > > > So do I have to use gold to solve this issue?
> > > > > 
> > > > > Yes.  Or you fix collect2 to do processing of 
> archives and hand
> > > > > lto1 the required information (it expects archive components
> > > > > with LTO bytecode like archiv...@offset with offset being the
> > > > > offset of the .o file with LTO bytecode inside the 
> archive).  See
> > > > > lto/lto-elf.c:lto_obj_file_open for "details".
> > > > > 
> > > > > Richard.
> > > > > 
> > > > > > Many thanks,
> > > > > > Bingfeng
> > > > > >
> > > > > 
> > > > > 
> > > 
> > > 
> 
> 

Reply via email to