diff options
author | Jan Hubicka <jh@suse.cz> | 2010-05-30 15:42:23 +0200 |
---|---|---|
committer | Jan Hubicka <hubicka@gcc.gnu.org> | 2010-05-30 13:42:23 +0000 |
commit | 0a5fa5a1a212c8096f2ee246ef1739ba0083e213 (patch) | |
tree | 177f0ffb133f35d5a844f6804649e024de4423fe | |
parent | 0b9c3a04049b790ea3aa6afcfef611088496be9d (diff) | |
download | gcc-0a5fa5a1a212c8096f2ee246ef1739ba0083e213.tar.gz |
cgraph.h (cgraph_dump_file): Declare.
* 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.
* lto.c (promote_var, promote_fn, lto_wpa_write_files): Dump
partitioning decisions.
From-SVN: r160053
-rw-r--r-- | gcc/ChangeLog | 7 | ||||
-rw-r--r-- | gcc/cgraph.h | 1 | ||||
-rw-r--r-- | gcc/cgraphunit.c | 2 | ||||
-rw-r--r-- | gcc/ipa.c | 6 | ||||
-rw-r--r-- | gcc/lto/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/lto/lto.c | 28 |
6 files changed, 46 insertions, 3 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 12fe9f980c8..87f74a69901 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,5 +1,12 @@ 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, premark_types_used_by_global_vars_helper): Avoid creating of new varool nodes. diff --git a/gcc/cgraph.h b/gcc/cgraph.h index 8e2be0862c4..3c91f0498c8 100644 --- a/gcc/cgraph.h +++ b/gcc/cgraph.h @@ -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); diff --git a/gcc/cgraphunit.c b/gcc/cgraphunit.c index b9c8e79ac61..3dfbc927d13 100644 --- a/gcc/cgraphunit.c +++ b/gcc/cgraphunit.c @@ -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; diff --git a/gcc/ipa.c b/gcc/ipa.c index 906fa66d569..fcd0253e5eb 100644 --- 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. */ diff --git a/gcc/lto/ChangeLog b/gcc/lto/ChangeLog index 6c60acd2dbf..c67cee78d9f 100644 --- a/gcc/lto/ChangeLog +++ b/gcc/lto/ChangeLog @@ -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. diff --git a/gcc/lto/lto.c b/gcc/lto/lto.c index 8389be1e015..5031659d740 100644 --- a/gcc/lto/lto.c +++ b/gcc/lto/lto.c @@ -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); |