This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Disable ipa-reference with -fprofile-arcs


> On Mon, 10 Jan 2011, Jan Hubicka wrote:
> 
> > Hi,
> > this patch workarounds problems with ipa-reference and profile feedback.
> > Profile feedback adds static var access into every function in program.
> > Especially with LTO this makes ipa-reference tables to explode.  It is the case
> > for Mozilla build where LTO -fprofile-generate OOms for me after allocating 9GB
> > of bitmaps.
> > 
> > lto-Profilebootstrapped/regtested x86_64-linux, OK?
> 
> Can't we just identify those vars and not track them at all?  They

I think we want to track orhter kinds of artifical vars - not sure what kinds
we produce however. We surely can do some name matching or pass down a flag.
Overall however, I think it is a lot easier to just disable the pass - we are
speaking of -fprofile-generate mode only and clearly ipa-reference needs to go
and be replaced by ipa-PTA (or more fine grained analysis) in longer run.

> are DECL_ARTIFICIAL after all.  OTOH, why does one or two bits
> per function blow up memory usage so much?

Because we build mask of vars known to be not set/used by the function.  This
usually contains all the counter arrays except the one used by the function.
So we end up with O(n*m) where n is number of functions and m is number of
arrays.  For Mozilla this is quite high. I think there are constant number of
arrays for every file, but Mozilla has many files.

We also might go for disabling with -fprofile-generate -fprofile-arcs -flto
only: I plan to drive users for not using LTO for training run anyway (and
modify profiledbootstrap accordingly)

Honza
> 
> Richard.
> 
> > Honza
> > 
> > 	PR tree-optimization/47233
> > 	* opts.c (common_handle_option): Disable ipa-reference with profile feedback.
> > Index: opts.c
> > ===================================================================
> > --- opts.c	(revision 168596)
> > +++ opts.c	(working copy)
> > @@ -1561,6 +1561,11 @@ common_handle_option (struct gcc_options
> >  	opts->x_flag_value_profile_transformations = value;
> >        if (!opts_set->x_flag_inline_functions)
> >  	opts->x_flag_inline_functions = value;
> > +      /* FIXME: Instrumentation we insert makes ipa-reference bitmaps
> > +	 quadratic.  Disable the pass until better memory representation
> > +	 is done.  */
> > +      if (!opts_set->x_flag_ipa_reference)
> > +        opts->x_flag_ipa_reference = false;
> >        break;
> >  
> >      case OPT_fshow_column:


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]