From b3e44629b84562454405c9b17c639e50c536e3b6 Mon Sep 17 00:00:00 2001 From: Andi Kleen Date: Sat, 8 Sep 2012 17:26:07 +0000 Subject: [PATCH] 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 * 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 --- gcc/ChangeLog | 7 +++++++ gcc/common.opt | 4 ++++ gcc/doc/invoke.texi | 7 ++++++- gcc/lto/lto.c | 2 ++ 4 files changed, 19 insertions(+), 1 deletion(-) diff --git a/gcc/ChangeLog b/gcc/ChangeLog index b4592a5..10d9344 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,10 @@ +2012-09-08 Andi Kleen + + * 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 * config/moxie/moxie.c (moxie_expand_prologue): Optimize prologue diff --git a/gcc/common.opt b/gcc/common.opt index 87e28b5..73eebf4 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -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. diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi index 3c46cd9..994e4db 100644 --- a/gcc/doc/invoke.texi +++ b/gcc/doc/invoke.texi @@ -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 diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 5da5412..3c59299 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -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 (); } -- 2.7.4