Add -flto-report-wpa
authorAndi Kleen <ak@linux.intel.com>
Tue, 23 Apr 2013 03:10:02 +0000 (03:10 +0000)
committerAndi Kleen <ak@gcc.gnu.org>
Tue, 23 Apr 2013 03:10:02 +0000 (03:10 +0000)
-flto-report is useful, but it prints for every LTRANS pass and
is very noisy and the main problem is often in WPA only.

Add a new -flto-report-wpa option that is only printed for WPA.

gcc/:

2013-04-22  Andi Kleen  <ak@linux.intel.com>

* common.opt (-flto-report-wpa): Add.
* doc/invoke.texi (-flto-report-wpa): Add.
* lto/lto.c (do_whole_program_analysis): Check for lto-report-wpa.
(lto_main): dito.

From-SVN: r198172

gcc/ChangeLog
gcc/common.opt
gcc/doc/invoke.texi
gcc/lto/lto.c

index 3ea7fa7654f16dc9645440a101ca40d7ce511fe3..7500eb7bde421d1b5f1f52e709ecca2605b121ea 100644 (file)
@@ -1,3 +1,10 @@
+2013-04-22  Andi Kleen  <ak@linux.intel.com>
+
+       * common.opt (-flto-report-wpa): Add.
+       * doc/invoke.texi (-flto-report-wpa): Add.
+       * lto/lto.c (do_whole_program_analysis): Check for lto-report-wpa.
+       (lto_main): dito.
+
 2013-04-22  Xinliang David Li  <davidxl@google.com>
 
        * graph.c (draw_cfg_node_succ_edges): Add branch probility as label.
index f0cb9e8075e222565f49ddb937e08326218357ea..8be32e57d3e04df06c35989bc48ab01534b8b6ef 100644 (file)
@@ -1504,6 +1504,10 @@ flto-report
 Common Report Var(flag_lto_report) Init(0)
 Report various link-time optimization statistics
 
+flto-report-wpa
+Common Report Var(flag_lto_report_wpa) Init(0)
+Report various link-time optimization statistics for WPA only
+
 fmath-errno
 Common Report Var(flag_errno_math) Init(1) Optimization SetByCombined
 Set errno after built-in math functions
index 782b5695472a8b78e89beb40ea1c5841ee34f488..034845db1e9bcbe30e8e3c86327d0919cb31c80e 100644 (file)
@@ -379,7 +379,7 @@ Objective-C and Objective-C++ Dialects}.
 -fivopts -fkeep-inline-functions -fkeep-static-consts @gol
 -floop-block -floop-interchange -floop-strip-mine -floop-nest-optimize @gol
 -floop-parallelize-all -flto -flto-compression-level @gol
--flto-partition=@var{alg} -flto-report -fmerge-all-constants @gol
+-flto-partition=@var{alg} -flto-report -flto-report-wpa -fmerge-all-constants @gol
 -fmerge-constants -fmodulo-sched -fmodulo-sched-allow-regmoves @gol
 -fmove-loop-invariants fmudflap -fmudflapir -fmudflapth -fno-branch-count-reg @gol
 -fno-default-inline @gol
@@ -8455,6 +8455,10 @@ files in LTO mode (via @option{-flto}).
 
 Disabled by default.
 
+@item -flto-report-wpa
+Like @option{-flto-report}, but only print for the WPA phase of Link
+Time Optimization.
+
 @item -fuse-linker-plugin
 Enables the use of a linker plugin during link-time optimization.  This
 option relies on plugin support in the linker, which is available in gold
index 983fa03aa1c4fd1bdd51090dce2e304ba40e4c5d..f19bbb5bc624e16aa78bc35443ae77a55bddb586 100644 (file)
@@ -3274,7 +3274,7 @@ do_whole_program_analysis (void)
     }
 
   /* Show the LTO report before launching LTRANS.  */
-  if (flag_lto_report)
+  if (flag_lto_report || (flag_wpa && flag_lto_report_wpa))
     print_lto_report_1 ();
   if (mem_report_wpa)
     dump_memory_report (true);
@@ -3402,7 +3402,7 @@ lto_main (void)
             print_lto_report before launching LTRANS.  If LTRANS was
             launched directly by the driver we would not need to do
             this.  */
-         if (flag_lto_report)
+         if (flag_lto_report || (flag_wpa && flag_lto_report_wpa))
            print_lto_report_1 ();
 
          /* Record the global variables.  */