diff mbox

Reduce -flto -fprofile-generate memory use

Message ID 20140417060106.GB3767@kam.mff.cuni.cz
State New
Headers show

Commit Message

Jan Hubicka April 17, 2014, 6:01 a.m. UTC
Hi,
while compiling firefox I noticed that -fprofile-generage -flto goes to 8GB.
It turns out that this is caused by ipa_reference no longer being disabled
becaus in_lto_p became flag that is set later (it is not clear to me why it
needs to be this way).

I however do not see reason why not disable ipa-reference for non-lto path, too.

Bootstrapped/regtested x86_linux, comitted to mainline.
OK for 4.9.1?

Honza

Comments

Richard Biener April 17, 2014, 7:47 a.m. UTC | #1
On Thu, 17 Apr 2014, Jan Hubicka wrote:

> Hi,
> while compiling firefox I noticed that -fprofile-generage -flto goes to 8GB.
> It turns out that this is caused by ipa_reference no longer being disabled
> becaus in_lto_p became flag that is set later (it is not clear to me why it
> needs to be this way).
> 
> I however do not see reason why not disable ipa-reference for non-lto path, too.
> 
> Bootstrapped/regtested x86_linux, comitted to mainline.
> OK for 4.9.1?

Yes.

Thanks,
Richard.

> Honza
> 
> Index: ChangeLog
> ===================================================================
> --- ChangeLog	(revision 209461)
> +++ ChangeLog	(working copy)
> @@ -1,5 +1,10 @@
>  2014-04-16  Jan Hubicka  <hubicka@ucw.cz>
>  
> +	* opts.c (common_handle_option): Disable -fipa-reference coorectly
> +	with -fuse-profile.
> +
> +2014-04-16  Jan Hubicka  <hubicka@ucw.cz>
> +
>  	* ipa-devirt.c (odr_type_d): Add field all_derivations_known.
>  	(type_all_derivations_known_p): New predicate.
>  	(type_all_ctors_visible_p): New predicate.
> Index: opts.c
> ===================================================================
> --- opts.c	(revision 209461)
> +++ opts.c	(working copy)
> @@ -1732,7 +1732,7 @@ common_handle_option (struct gcc_options
>        /* 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_in_lto_p)
> +      if (!opts_set->x_flag_ipa_reference)
>          opts->x_flag_ipa_reference = false;
>        break;
>  
> 
>
Gerald Pfeifer April 26, 2014, 8:29 p.m. UTC | #2
On Thu, 17 Apr 2014, Jan Hubicka wrote:
> +	* opts.c (common_handle_option): Disable -fipa-reference coorectly
> +	with -fuse-profile.

coorectly -> correctly

Gerald
diff mbox

Patch

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 209461)
+++ ChangeLog	(working copy)
@@ -1,5 +1,10 @@ 
 2014-04-16  Jan Hubicka  <hubicka@ucw.cz>
 
+	* opts.c (common_handle_option): Disable -fipa-reference coorectly
+	with -fuse-profile.
+
+2014-04-16  Jan Hubicka  <hubicka@ucw.cz>
+
 	* ipa-devirt.c (odr_type_d): Add field all_derivations_known.
 	(type_all_derivations_known_p): New predicate.
 	(type_all_ctors_visible_p): New predicate.
Index: opts.c
===================================================================
--- opts.c	(revision 209461)
+++ opts.c	(working copy)
@@ -1732,7 +1732,7 @@  common_handle_option (struct gcc_options
       /* 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_in_lto_p)
+      if (!opts_set->x_flag_ipa_reference)
         opts->x_flag_ipa_reference = false;
       break;