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
This commit is contained in:
Jan Hubicka 2010-05-30 15:42:23 +02:00 committed by Jan Hubicka
parent 0b9c3a0404
commit 0a5fa5a1a2
6 changed files with 46 additions and 3 deletions

View 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,

View 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);

View 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;

View File

@ -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. */

View 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.

View 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);