Clean-up IPA profile dump output.
authorMartin Liska <mliska@suse.cz>
Tue, 23 Jan 2018 12:26:37 +0000 (13:26 +0100)
committerMartin Liska <marxin@gcc.gnu.org>
Tue, 23 Jan 2018 12:26:37 +0000 (12:26 +0000)
2018-01-23  Martin Liska  <mliska@suse.cz>

* tree-profile.c (tree_profiling): Print function header to
aware reader which function we are working on.
* value-prof.c (gimple_find_values_to_profile): Do not print
not interesting value histograms.

From-SVN: r256983

gcc/ChangeLog
gcc/tree-profile.c
gcc/value-prof.c

index 19b2137..fd93bc8 100644 (file)
@@ -1,5 +1,12 @@
 2018-01-23  Martin Liska  <mliska@suse.cz>
 
+       * tree-profile.c (tree_profiling): Print function header to
+       aware reader which function we are working on.
+       * value-prof.c (gimple_find_values_to_profile): Do not print
+       not interesting value histograms.
+
+2018-01-23  Martin Liska  <mliska@suse.cz>
+
        * profile-count.h (enum profile_quality): Add
        profile_uninitialized as the first value. Do not number values
        as they are zero based.
index 9d91906..f96bd4b 100644 (file)
@@ -52,6 +52,7 @@ along with GCC; see the file COPYING3.  If not see
 #include "params.h"
 #include "stringpool.h"
 #include "attribs.h"
+#include "tree-pretty-print.h"
 
 static GTY(()) tree gcov_type_node;
 static GTY(()) tree tree_interval_profiler_fn;
@@ -671,6 +672,9 @@ tree_profiling (void)
 
       push_cfun (DECL_STRUCT_FUNCTION (node->decl));
 
+      if (dump_file)
+       dump_function_header (dump_file, cfun->decl, dump_flags);
+
       /* Local pure-const may imply need to fixup the cfg.  */
       if (execute_fixup_cfg () & TODO_cleanup_cfg)
        cleanup_tree_cfg ();
index b503320..16cdbd6 100644 (file)
@@ -2053,7 +2053,7 @@ gimple_find_values_to_profile (histogram_values *values)
        default:
          gcc_unreachable ();
        }
-      if (dump_file)
+      if (dump_file && hist->hvalue.stmt != NULL)
         {
          fprintf (dump_file, "Stmt ");
           print_gimple_stmt (dump_file, hist->hvalue.stmt, 0, TDF_SLIM);