Add -fmem-report-wpa

For parallel LTO builds setting -fmem-report does not work very well
because all the LTRANS phases dump it in parallel and typically interleave
it to unreadability.

Since usually the memory bottleneck is WPA add a flag to only dump
the memory report for that.

gcc/:
2012-09-08  Andi Kleen  <ak@linux.intel.com>

	* gcc/common.opt (-fmem-report-wpa): Add
	* gcc/doc/invoke.texi (-fmem-report-wpa): Document.
	* gcc/lto/lto.c (do_whole_program_analysis): Run mem_report
	when mem_report_wpa is set.

From-SVN: r191095
This commit is contained in:
Andi Kleen 2012-09-08 17:26:07 +00:00 committed by Andi Kleen
parent 1a760de952
commit b3e44629b8
4 changed files with 19 additions and 1 deletions

View File

@ -1,3 +1,10 @@
2012-09-08 Andi Kleen <ak@linux.intel.com>
* gcc/common.opt (-fmem-report-wpa): Add
* gcc/doc/invoke.texi (-fmem-report-wpa): Document.
* gcc/lto/lto.c (do_whole_program_analysis): Run mem_report
when mem_report_wpa is set.
2012-09-07 Anthony Green <green@moxielogic.com>
* config/moxie/moxie.c (moxie_expand_prologue): Optimize prologue

View File

@ -1470,6 +1470,10 @@ fmem-report
Common Report Var(mem_report)
Report on permanent memory allocation
fmem-report-wpa
Common Report Var(mem_report_wpa)
Report on permanent memory allocation in WPA only
; This will attempt to merge constant section constants, if 1 only
; string constants and constants from constant pool, if 2 also constant
; variables.

View File

@ -328,7 +328,7 @@ Objective-C and Objective-C++ Dialects}.
-feliminate-unused-debug-symbols -femit-class-debug-always @gol
-fenable-@var{kind}-@var{pass} @gol
-fenable-@var{kind}-@var{pass}=@var{range-list} @gol
-fdebug-types-section @gol
-fdebug-types-section -fmem-report-wpa @gol
-fmem-report -fpre-ipa-mem-report -fpost-ipa-mem-report -fprofile-arcs @gol
-frandom-seed=@var{string} -fsched-verbose=@var{n} @gol
-fsel-sched-verbose -fsel-sched-dump-cfg -fsel-sched-pipelining-verbose @gol
@ -5132,6 +5132,11 @@ pass when it finishes.
Makes the compiler print some statistics about permanent memory
allocation when it finishes.
@item -fmem-report-wpa
@opindex fmem-report-wpa
Makes the compiler print some statistics about permanent memory
allocation for the WPA phase only.
@item -fpre-ipa-mem-report
@opindex fpre-ipa-mem-report
@item -fpost-ipa-mem-report

View File

@ -2016,6 +2016,8 @@ do_whole_program_analysis (void)
/* Show the LTO report before launching LTRANS. */
if (flag_lto_report)
print_lto_report ();
if (mem_report_wpa)
dump_mem_report ();
}