]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
* cgraph.h (cgraph_dump_file): Declare.
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 30 May 2010 13:42:23 +0000 (13:42 +0000)
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>
Sun, 30 May 2010 13:42:23 +0000 (13:42 +0000)
* cgraphunit.c (cgraph_dump_file): Export.
* ipa.c (dump_cgraph_node_set, dump_varpool_node_set): Be less
verbose.

* lto.c (promote_var, promote_fn, lto_wpa_write_files): Dump
partitioning decisions.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160053 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/cgraph.h
gcc/cgraphunit.c
gcc/ipa.c
gcc/lto/ChangeLog
gcc/lto/lto.c

index 12fe9f980c8928f475f143d6a17b08f5a9aad2f0..87f74a699014b05d7fce9a663cf724234f9830e7 100644 (file)
@@ -1,3 +1,10 @@
+2010-05-30  Jan Hubicka  <jh@suse.cz>
+
+       * cgraph.h (cgraph_dump_file): Declare.
+       * cgraphunit.c (cgraph_dump_file): Export.
+       * ipa.c (dump_cgraph_node_set, dump_varpool_node_set): Be less
+       verbose.
+
 2010-05-30  Jan Hubicka  <jh@suse.cz>
 
        * dwarf2out.c (reference_to_unused,
index 8e2be0862c42828ac4a84071d4f033ba9a186b63..3c91f0498c8e291159312c1a3c472d1bcea3ee9c 100644 (file)
@@ -598,6 +598,7 @@ bool cgraph_node_cannot_return (struct cgraph_node *);
 bool cgraph_edge_cannot_lead_to_return (struct cgraph_edge *);
 
 /* In cgraphunit.c  */
+extern FILE *cgraph_dump_file;
 void cgraph_finalize_function (tree, bool);
 void cgraph_mark_if_needed (tree);
 void cgraph_finalize_compilation_unit (void);
index b9c8e79ac6191bbe91497ac1f9d48a5500813979..3dfbc927d1370bbc89174184a2afedd230df18df 100644 (file)
@@ -145,7 +145,7 @@ static void cgraph_expand_function (struct cgraph_node *);
 static void cgraph_output_pending_asms (void);
 static void cgraph_analyze_function (struct cgraph_node *);
 
-static FILE *cgraph_dump_file;
+FILE *cgraph_dump_file;
 
 /* A vector of FUNCTION_DECLs declared as static constructors.  */
 static GTY (()) VEC(tree, gc) *static_ctors;
index 906fa66d5694445bc44b3eb53ef63eb78c8d5d64..fcd0253e5ebf94530cd57166a0380d174b391fc5 100644 (file)
--- a/gcc/ipa.c
+++ b/gcc/ipa.c
@@ -1002,8 +1002,9 @@ dump_cgraph_node_set (FILE *f, cgraph_node_set set)
   for (iter = csi_start (set); !csi_end_p (iter); csi_next (&iter))
     {
       struct cgraph_node *node = csi_node (iter);
-      dump_cgraph_node (f, node);
+      fprintf (f, " %s/%i", cgraph_node_name (node), node->uid);
     }
+  fprintf (f, "\n");
 }
 
 /* Dump content of SET to stderr.  */
@@ -1159,8 +1160,9 @@ dump_varpool_node_set (FILE *f, varpool_node_set set)
   for (iter = vsi_start (set); !vsi_end_p (iter); vsi_next (&iter))
     {
       struct varpool_node *node = vsi_node (iter);
-      dump_varpool_node (f, node);
+      fprintf (f, " %s", varpool_node_name (node));
     }
+  fprintf (f, "\n");
 }
 
 /* Dump content of SET to stderr.  */
index 6c60acd2dbf2ee5161393abd8a5f6ca6e513a7c5..c67cee78d9f5d4beab8276407f3f5303dd27e321 100644 (file)
@@ -1,3 +1,8 @@
+2010-05-30  Jan Hubicka  <jh@suse.cz>
+
+       * lto.c (promote_var, promote_fn, lto_wpa_write_files): Dump
+       partitioning decisions.
+
 2010-05-29  Jan Hubicka  <jh@suse.cz>
 
        * lto.c (bitmap vector): Remove.
index 8389be1e015ef44ef5fe0d384c9b7bbab70ed074..5031659d740abad79d57a40348bce9944df1865f 100644 (file)
@@ -636,6 +636,9 @@ promote_var (struct varpool_node *vnode)
   gcc_assert (flag_wpa);
   TREE_PUBLIC (vnode->decl) = 1;
   DECL_VISIBILITY (vnode->decl) = VISIBILITY_HIDDEN;
+  if (cgraph_dump_file)
+    fprintf (cgraph_dump_file,
+           "Promoting var as hidden: %s\n", varpool_node_name (vnode));
   return true;
 }
 
@@ -659,6 +662,10 @@ promote_fn (struct cgraph_node *node)
          DECL_VISIBILITY (alias->decl) = VISIBILITY_HIDDEN;
        }
     }
+  if (cgraph_dump_file)
+    fprintf (cgraph_dump_file,
+            "Promoting function as hidden: %s/%i\n",
+            cgraph_node_name (node), node->uid);
   return true;
 }
 
@@ -862,6 +869,15 @@ lto_wpa_write_files (void)
 
       if (!quiet_flag)
        fprintf (stderr, " %s (%s %i insns)", temp_filename, part->name, part->insns);
+      if (cgraph_dump_file)
+       {
+         fprintf (cgraph_dump_file, "Writting partition %s to file %s, %i insns\n",
+                  part->name, temp_filename, part->insns);
+         fprintf (cgraph_dump_file, "cgraph nodes:");
+         dump_cgraph_node_set (cgraph_dump_file, set);
+         fprintf (cgraph_dump_file, "varpool nodes:");
+         dump_varpool_node_set (cgraph_dump_file, vset);
+       }
       gcc_assert (cgraph_node_set_nonempty_p (set)
                  || varpool_node_set_nonempty_p (vset) || !i);
 
@@ -1632,6 +1648,12 @@ do_whole_program_analysis (void)
       dump_memory_report (false);
     }
 
+  if (cgraph_dump_file)
+    {
+      dump_cgraph (cgraph_dump_file);
+      dump_varpool (cgraph_dump_file);
+    }
+
   cgraph_function_flags_ready = true;
   bitmap_obstack_initialize (NULL);
   ipa_register_cgraph_hooks ();
@@ -1639,6 +1661,12 @@ do_whole_program_analysis (void)
 
   execute_ipa_pass_list (all_regular_ipa_passes);
 
+  if (cgraph_dump_file)
+    {
+      fprintf (cgraph_dump_file, "Optimized ");
+      dump_cgraph (cgraph_dump_file);
+      dump_varpool (cgraph_dump_file);
+    }
   verify_cgraph ();
   bitmap_obstack_release (NULL);