Commit 0a5fa5a1 by Jan Hubicka Committed by Jan Hubicka

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
parent 0b9c3a04
2010-05-30 Jan Hubicka <jh@suse.cz> 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, * dwarf2out.c (reference_to_unused,
premark_types_used_by_global_vars_helper): Avoid creating of new premark_types_used_by_global_vars_helper): Avoid creating of new
varool nodes. varool nodes.
......
...@@ -598,6 +598,7 @@ bool cgraph_node_cannot_return (struct cgraph_node *); ...@@ -598,6 +598,7 @@ bool cgraph_node_cannot_return (struct cgraph_node *);
bool cgraph_edge_cannot_lead_to_return (struct cgraph_edge *); bool cgraph_edge_cannot_lead_to_return (struct cgraph_edge *);
/* In cgraphunit.c */ /* In cgraphunit.c */
extern FILE *cgraph_dump_file;
void cgraph_finalize_function (tree, bool); void cgraph_finalize_function (tree, bool);
void cgraph_mark_if_needed (tree); void cgraph_mark_if_needed (tree);
void cgraph_finalize_compilation_unit (void); void cgraph_finalize_compilation_unit (void);
......
...@@ -145,7 +145,7 @@ static void cgraph_expand_function (struct cgraph_node *); ...@@ -145,7 +145,7 @@ static void cgraph_expand_function (struct cgraph_node *);
static void cgraph_output_pending_asms (void); static void cgraph_output_pending_asms (void);
static void cgraph_analyze_function (struct cgraph_node *); 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. */ /* A vector of FUNCTION_DECLs declared as static constructors. */
static GTY (()) VEC(tree, gc) *static_ctors; static GTY (()) VEC(tree, gc) *static_ctors;
......
...@@ -1002,8 +1002,9 @@ dump_cgraph_node_set (FILE *f, cgraph_node_set set) ...@@ -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)) for (iter = csi_start (set); !csi_end_p (iter); csi_next (&iter))
{ {
struct cgraph_node *node = csi_node (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. */ /* Dump content of SET to stderr. */
...@@ -1159,8 +1160,9 @@ dump_varpool_node_set (FILE *f, varpool_node_set set) ...@@ -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)) for (iter = vsi_start (set); !vsi_end_p (iter); vsi_next (&iter))
{ {
struct varpool_node *node = vsi_node (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. */ /* Dump content of SET to stderr. */
......
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> 2010-05-29 Jan Hubicka <jh@suse.cz>
* lto.c (bitmap vector): Remove. * lto.c (bitmap vector): Remove.
......
...@@ -636,6 +636,9 @@ promote_var (struct varpool_node *vnode) ...@@ -636,6 +636,9 @@ promote_var (struct varpool_node *vnode)
gcc_assert (flag_wpa); gcc_assert (flag_wpa);
TREE_PUBLIC (vnode->decl) = 1; TREE_PUBLIC (vnode->decl) = 1;
DECL_VISIBILITY (vnode->decl) = VISIBILITY_HIDDEN; 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; return true;
} }
...@@ -659,6 +662,10 @@ promote_fn (struct cgraph_node *node) ...@@ -659,6 +662,10 @@ promote_fn (struct cgraph_node *node)
DECL_VISIBILITY (alias->decl) = VISIBILITY_HIDDEN; 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; return true;
} }
...@@ -862,6 +869,15 @@ lto_wpa_write_files (void) ...@@ -862,6 +869,15 @@ lto_wpa_write_files (void)
if (!quiet_flag) if (!quiet_flag)
fprintf (stderr, " %s (%s %i insns)", temp_filename, part->name, part->insns); 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) gcc_assert (cgraph_node_set_nonempty_p (set)
|| varpool_node_set_nonempty_p (vset) || !i); || varpool_node_set_nonempty_p (vset) || !i);
...@@ -1632,6 +1648,12 @@ do_whole_program_analysis (void) ...@@ -1632,6 +1648,12 @@ do_whole_program_analysis (void)
dump_memory_report (false); dump_memory_report (false);
} }
if (cgraph_dump_file)
{
dump_cgraph (cgraph_dump_file);
dump_varpool (cgraph_dump_file);
}
cgraph_function_flags_ready = true; cgraph_function_flags_ready = true;
bitmap_obstack_initialize (NULL); bitmap_obstack_initialize (NULL);
ipa_register_cgraph_hooks (); ipa_register_cgraph_hooks ();
...@@ -1639,6 +1661,12 @@ do_whole_program_analysis (void) ...@@ -1639,6 +1661,12 @@ do_whole_program_analysis (void)
execute_ipa_pass_list (all_regular_ipa_passes); 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 (); verify_cgraph ();
bitmap_obstack_release (NULL); bitmap_obstack_release (NULL);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment