+2017-05-23 Martin Liska <mliska@suse.cz>
+
+ * cgraph.c (cgraph_node::get_create): Use symtab_node::dump_{asm_,}name
+ functions.
+ (cgraph_edge::make_speculative): Likewise.
+ (cgraph_edge::resolve_speculation): Likewise.
+ (cgraph_edge::redirect_call_stmt_to_callee): Likewise.
+ (cgraph_node::dump): Likewise.
+ * cgraph.h: Likewise.
+ * cgraphunit.c (analyze_functions): Likewise.
+ (symbol_table::compile): Likewise.
+ * ipa-cp.c (print_all_lattices): Likewise.
+ (determine_versionability): Likewise.
+ (initialize_node_lattices): Likewise.
+ (ipcp_verify_propagated_values): Likewise.
+ (estimate_local_effects): Likewise.
+ (update_profiling_info): Likewise.
+ (create_specialized_node): Likewise.
+ (perhaps_add_new_callers): Likewise.
+ (decide_about_value): Likewise.
+ (decide_whether_version_node): Likewise.
+ (identify_dead_nodes): Likewise.
+ (ipcp_store_bits_results): Likewise.
+ * ipa-devirt.c (dump_targets): Likewise.
+ (ipa_devirt): Likewise.
+ * ipa-icf.c (sem_item::dump): Likewise.
+ (sem_function::equals): Likewise.
+ (sem_variable::equals): Likewise.
+ (sem_item_optimizer::read_section): Likewise.
+ (sem_item_optimizer::execute): Likewise.
+ (congruence_class::dump): Likewise.
+ * ipa-inline-analysis.c (dump_ipa_call_summary): Likewise.
+ (dump_inline_summary): Likewise.
+ (estimate_node_size_and_time): Likewise.
+ (inline_analyze_function): Likewise.
+ * ipa-inline-transform.c (inline_call): Likewise.
+ * ipa-inline.c (report_inline_failed_reason): Likewise.
+ (want_early_inline_function_p): Likewise.
+ (edge_badness): Likewise.
+ (update_edge_key): Likewise.
+ (inline_small_functions): Likewise.
+ * ipa-profile.c (ipa_profile): Likewise.
+ * ipa-prop.c (ipa_print_node_jump_functions): Likewise.
+ (ipa_make_edge_direct_to_target): Likewise.
+ (remove_described_reference): Likewise.
+ (ipa_impossible_devirt_target): Likewise.
+ (propagate_controlled_uses): Likewise.
+ (ipa_print_node_params): Likewise.
+ (ipcp_transform_function): Likewise.
+ * ipa-pure-const.c (pure_const_read_summary): Likewise.
+ (propagate_pure_const): Likewise.
+ * ipa-reference.c (generate_summary): Likewise.
+ (read_write_all_from_decl): Likewise.
+ (propagate): Likewise.
+ (ipa_reference_read_optimization_summary): Likewise.
+ * ipa-utils.c (ipa_merge_profiles): Likewise.
+ * ipa.c (walk_polymorphic_call_targets): Likewise.
+ (symbol_table::remove_unreachable_nodes): Likewise.
+ (ipa_single_use): Likewise.
+ * passes.c (execute_todo): Likewise.
+ * predict.c (drop_profile): Likewise.
+ * symtab.c (symtab_node::get_dump_name): New function.
+ (symtab_node::dump_name): Likewise.
+ (symtab_node::dump_asm_name): Likewise.
+ (symtab_node::dump_references): Likewise.
+ (symtab_node::dump_referring): Likewise.
+ (symtab_node::dump_base): Likewise.
+ (symtab_node::debug_symtab): Likewise.
+ * tree-sra.c (convert_callers_for_node): Likewise.
+ * tree-ssa-structalias.c (ipa_pta_execute): Likewise.
+ * value-prof.c (init_node_map): Likewise.
+
2017-05-23 Martin Liska <mliska@suse.cz>
* cgraph.h: Move symtab_node::dump_table to symbol_table::dump
node->decl->decl_with_vis.symtab_node = node;
if (dump_file)
fprintf (dump_file, "Introduced new external node "
- "(%s/%i) and turned into root of the clone tree.\n",
- node->name (), node->order);
+ "(%s) and turned into root of the clone tree.\n",
+ node->dump_name ());
}
else if (dump_file)
fprintf (dump_file, "Introduced new external node "
- "(%s/%i).\n", node->name (), node->order);
+ "(%s).\n", node->dump_name ());
return node;
}
cgraph_edge *e2;
if (dump_file)
- {
- fprintf (dump_file, "Indirect call -> speculative call"
- " %s/%i => %s/%i\n",
- xstrdup_for_dump (n->name ()), n->order,
- xstrdup_for_dump (n2->name ()), n2->order);
- }
+ fprintf (dump_file, "Indirect call -> speculative call %s => %s\n",
+ n->dump_name (), n2->dump_name ());
speculative = true;
e2 = n->create_edge (n2, call_stmt, direct_count, direct_frequency);
initialize_inline_failed (e2);
{
if (callee_decl)
{
- fprintf (dump_file, "Speculative indirect call %s/%i => %s/%i has "
+ fprintf (dump_file, "Speculative indirect call %s => %s has "
"turned out to have contradicting known target ",
- xstrdup_for_dump (edge->caller->name ()),
- edge->caller->order,
- xstrdup_for_dump (e2->callee->name ()),
- e2->callee->order);
+ edge->caller->dump_name (),
+ e2->callee->dump_name ());
print_generic_expr (dump_file, callee_decl);
fprintf (dump_file, "\n");
}
else
{
- fprintf (dump_file, "Removing speculative call %s/%i => %s/%i\n",
- xstrdup_for_dump (edge->caller->name ()),
- edge->caller->order,
- xstrdup_for_dump (e2->callee->name ()),
- e2->callee->order);
+ fprintf (dump_file, "Removing speculative call %s => %s\n",
+ edge->caller->dump_name (),
+ e2->callee->dump_name ());
}
}
}
true))
{
if (dump_file)
- fprintf (dump_file, "Not expanding speculative call of %s/%i -> %s/%i\n"
+ fprintf (dump_file, "Not expanding speculative call of %s -> %s\n"
"Type mismatch.\n",
- xstrdup_for_dump (e->caller->name ()),
- e->caller->order,
- xstrdup_for_dump (e->callee->name ()),
- e->callee->order);
+ e->caller->dump_name (),
+ e->callee->dump_name ());
e = e->resolve_speculation ();
/* We are producing the final function body and will throw away the
callgraph edges really soon. Reset the counts/frequencies to
{
if (dump_file)
fprintf (dump_file,
- "Expanding speculative call of %s/%i -> %s/%i count: "
+ "Expanding speculative call of %s -> %s count: "
"%" PRId64"\n",
- xstrdup_for_dump (e->caller->name ()),
- e->caller->order,
- xstrdup_for_dump (e->callee->name ()),
- e->callee->order,
+ e->caller->dump_name (),
+ e->callee->dump_name (),
(int64_t)e->count);
gcc_assert (e2->speculative);
push_cfun (DECL_STRUCT_FUNCTION (e->caller->decl));
if (symtab->dump_file)
{
- fprintf (symtab->dump_file, "updating call of %s/%i -> %s/%i: ",
- xstrdup_for_dump (e->caller->name ()), e->caller->order,
- xstrdup_for_dump (e->callee->name ()), e->callee->order);
+ fprintf (symtab->dump_file, "updating call of %s -> %s: ",
+ e->caller->dump_name (), e->callee->dump_name ());
print_gimple_stmt (symtab->dump_file, e->call_stmt, 0, dump_flags);
if (e->callee->clone.combined_args_to_skip)
{
dump_base (f);
if (global.inlined_to)
- fprintf (f, " Function %s/%i is inline copy in %s/%i\n",
- xstrdup_for_dump (name ()),
- order,
- xstrdup_for_dump (global.inlined_to->name ()),
- global.inlined_to->order);
+ fprintf (f, " Function %s is inline copy in %s\n",
+ dump_name (),
+ global.inlined_to->dump_name ());
if (clone_of)
- fprintf (f, " Clone of %s/%i\n",
- clone_of->asm_name (),
- clone_of->order);
+ fprintf (f, " Clone of %s\n", clone_of->dump_asm_name ());
if (symtab->function_flags_ready)
fprintf (f, " Availability: %s\n",
cgraph_availability_names [get_availability ()]);
if (vi->prev != NULL)
{
fprintf (f, "prev: ");
- fprintf (f, "%s/%i ", vi->prev->this_node->asm_name (),
- vi->prev->this_node->order);
+ fprintf (f, "%s ", vi->prev->this_node->dump_asm_name ());
}
if (vi->next != NULL)
{
fprintf (f, "next: ");
- fprintf (f, "%s/%i ", vi->next->this_node->asm_name (),
- vi->next->this_node->order);
+ fprintf (f, "%s ", vi->next->this_node->dump_asm_name ());
}
if (vi->dispatcher_resolver != NULL_TREE)
fprintf (f, "dispatcher: %s",
for (edge = callers; edge; edge = edge->next_caller)
{
- fprintf (f, "%s/%i ", edge->caller->asm_name (),
- edge->caller->order);
+ fprintf (f, "%s ", edge->caller->dump_name ());
edge->dump_edge_flags (f);
}
fprintf (f, "\n Calls: ");
for (edge = callees; edge; edge = edge->next_callee)
{
- fprintf (f, "%s/%i ", edge->callee->asm_name (),
- edge->callee->order);
+ fprintf (f, "%s ", edge->callee->dump_name ());
edge->dump_edge_flags (f);
}
fprintf (f, "\n");
/* Return name. */
const char *name () const;
+ /* Return dump name. */
+ const char *dump_name () const;
+
/* Return asm name. */
- const char * asm_name () const;
+ const char *asm_name () const;
+
+ /* Return dump name with assembler name. */
+ const char *dump_asm_name () const;
/* Add node into symbol table. This function is not used directly, but via
cgraph/varpool node creation routines. */
/* Worker for ultimate_alias_target. */
symtab_node *ultimate_alias_target_1 (enum availability *avail = NULL,
symtab_node *ref = NULL);
+
+ /* Get dump name with normal or assembly name. */
+ const char *get_dump_name (bool asm_name_p) const;
};
inline void
struct ipa_node_params *info;
info = IPA_NODE_REF (node);
- fprintf (f, " Node: %s/%i:\n", node->name (),
- node->order);
+ fprintf (f, " Node: %s:\n", node->dump_name ());
count = ipa_get_param_count (info);
for (i = 0; i < count; i++)
{
}
if (reason && dump_file && !node->alias && !node->thunk.thunk_p)
- fprintf (dump_file, "Function %s/%i is not versionable, reason: %s.\n",
- node->name (), node->order, reason);
+ fprintf (dump_file, "Function %s is not versionable, reason: %s.\n",
+ node->dump_name (), reason);
info->versionable = (reason == NULL);
}
}
if (dump_file && (dump_flags & TDF_DETAILS)
&& !node->alias && !node->thunk.thunk_p)
- fprintf (dump_file, "Marking all lattices of %s/%i as %s\n",
- node->name (), node->order,
- disable ? "BOTTOM" : "VARIABLE");
+ fprintf (dump_file, "Marking all lattices of %s as %s\n",
+ node->dump_name (), disable ? "BOTTOM" : "VARIABLE");
}
for (ie = node->indirect_calls; ie; ie = ie->next_callee)
return;
if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "\nEstimating effects for %s/%i.\n",
- node->name (), node->order);
+ fprintf (dump_file, "\nEstimating effects for %s.\n", node->dump_name ());
always_const = gather_context_independent_values (info, &known_csts,
&known_contexts, &known_aggs,
if (orig_node_count < orig_sum + new_sum)
{
if (dump_file)
- fprintf (dump_file, " Problem: node %s/%i has too low count "
+ fprintf (dump_file, " Problem: node %s has too low count "
HOST_WIDE_INT_PRINT_DEC " while the sum of incoming "
"counts is " HOST_WIDE_INT_PRINT_DEC "\n",
- orig_node->name (), orig_node->order,
+ orig_node->dump_name (),
(HOST_WIDE_INT) orig_node_count,
(HOST_WIDE_INT) (orig_sum + new_sum));
if (dump_file && (dump_flags & TDF_DETAILS))
{
- fprintf (dump_file, " the new node is %s/%i.\n",
- new_node->name (), new_node->order);
+ fprintf (dump_file, " the new node is %s.\n", new_node->dump_name ());
if (known_contexts.exists ())
{
for (i = 0; i < count; i++)
&& cgraph_edge_brings_all_agg_vals_for_node (cs, val->spec_node))
{
if (dump_file)
- fprintf (dump_file, " - adding an extra caller %s/%i"
- " of %s/%i\n",
- xstrdup_for_dump (cs->caller->name ()),
- cs->caller->order,
- xstrdup_for_dump (val->spec_node->name ()),
- val->spec_node->order);
+ fprintf (dump_file, " - adding an extra caller %s of %s\n",
+ cs->caller->dump_name (),
+ val->spec_node->dump_name ());
cs->redirect_callee_duplicating_thunks (val->spec_node);
val->spec_node->expand_all_artificial_thunks ();
return false;
if (dump_file)
- fprintf (dump_file, " Creating a specialized node of %s/%i.\n",
- node->name (), node->order);
+ fprintf (dump_file, " Creating a specialized node of %s.\n",
+ node->dump_name ());
callers = gather_edges_for_value (val, node, caller_count);
if (offset == -1)
return false;
if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "\nEvaluating opportunities for %s/%i.\n",
- node->name (), node->order);
+ fprintf (dump_file, "\nEvaluating opportunities for %s.\n",
+ node->dump_name ());
gather_context_independent_values (info, &known_csts, &known_contexts,
info->do_clone_for_all_contexts ? &known_aggs
vec<cgraph_edge *> callers;
if (dump_file)
- fprintf (dump_file, " - Creating a specialized node of %s/%i "
- "for all known contexts.\n", node->name (),
- node->order);
+ fprintf (dump_file, " - Creating a specialized node of %s "
+ "for all known contexts.\n", node->dump_name ());
callers = node->collect_callers ();
{
for (v = node; v; v = ((struct ipa_dfs_info *) v->aux)->next_cycle)
if (IPA_NODE_REF (v)->node_dead)
- fprintf (dump_file, " Marking node as dead: %s/%i.\n",
- v->name (), v->order);
+ fprintf (dump_file, " Marking node as dead: %s.\n", v->dump_name ());
}
}
continue;
if (!dumped_sth)
{
- fprintf (dump_file, "Propagated bits info for function %s/%i:\n",
- node->name (), node->order);
+ fprintf (dump_file, "Propagated bits info for function %s:\n",
+ node->dump_name ());
dumped_sth = true;
}
fprintf (dump_file, " param %i: value = ", i);
char *name = NULL;
if (in_lto_p)
name = cplus_demangle_v3 (targets[i]->asm_name (), 0);
- fprintf (f, " %s/%i", name ? name : targets[i]->name (), targets[i]->order);
+ fprintf (f, " %s/%i", name ? name : targets[i]->name (),
+ targets[i]->order);
if (in_lto_p)
free (name);
if (!targets[i]->definition)
if (!opt_for_fn (n->decl, flag_devirtualize))
continue;
if (dump_file && n->indirect_calls)
- fprintf (dump_file, "\n\nProcesing function %s/%i\n",
- n->name (), n->order);
+ fprintf (dump_file, "\n\nProcesing function %s\n",
+ n->dump_name ());
for (e = n->indirect_calls; e; e = e->next_callee)
if (e->indirect_info->polymorphic)
{
{
location_t locus = gimple_location_safe (e->call_stmt);
dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, locus,
- "speculatively devirtualizing call in %s/%i to %s/%i\n",
- n->name (), n->order,
- likely_target->name (),
- likely_target->order);
+ "speculatively devirtualizing call "
+ "in %s to %s\n",
+ n->dump_name (),
+ likely_target->dump_name ());
}
if (!likely_target->can_be_discarded_p ())
{
{
if (dump_file)
{
- fprintf (dump_file, "[%s] %s (%u) (tree:%p)\n", type == FUNC ? "func" : "var",
- node->name(), node->order, (void *) node->decl);
+ fprintf (dump_file, "[%s] %s (tree:%p)\n", type == FUNC ? "func" : "var",
+ node->dump_name (), (void *) node->decl);
fprintf (dump_file, " hash: %u\n", get_hash ());
fprintf (dump_file, " references: ");
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,
- "Equals called for:%s:%s (%u:%u) (%s:%s) with result: %s\n\n",
- xstrdup_for_dump (node->name()),
- xstrdup_for_dump (item->node->name ()),
- node->order,
- item->node->order,
- xstrdup_for_dump (node->asm_name ()),
- xstrdup_for_dump (item->node->asm_name ()),
+ "Equals called for: %s:%s with result: %s\n\n",
+ node->dump_name (),
+ item->node->dump_name (),
eq ? "true" : "false");
return eq;
DECL_INITIAL (item->node->decl));
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file,
- "Equals called for vars:%s:%s (%u:%u) (%s:%s) with result: %s\n\n",
- xstrdup_for_dump (node->name()),
- xstrdup_for_dump (item->node->name ()),
- node->order, item->node->order,
- xstrdup_for_dump (node->asm_name ()),
- xstrdup_for_dump (item->node->asm_name ()), ret ? "true" : "false");
+ "Equals called for vars: %s:%s with result: %s\n\n",
+ node->dump_name (), item->node->dump_name (),
+ ret ? "true" : "false");
return ret;
}
gcc_assert (node->definition);
if (dump_file)
- fprintf (dump_file, "Symbol added:%s (tree: %p, uid:%u)\n",
- node->asm_name (), (void *) node->decl, node->order);
+ fprintf (dump_file, "Symbol added: %s (tree: %p)\n",
+ node->dump_asm_name (), (void *) node->decl);
if (is_a<cgraph_node *> (node))
{
FPUTS_SPACES (file, indent + 2, "");
for (unsigned i = 0; i < members.length (); i++)
- fprintf (file, "%s(%p/%u) ", members[i]->node->asm_name (),
- (void *) members[i]->decl,
- members[i]->node->order);
+ fprintf (file, "%s ", members[i]->node->dump_asm_name ());
fprintf (file, "\n");
}
cl_optimization_restore (&opts, opts_for_fn (to->decl));
opts.x_flag_strict_aliasing = false;
if (dump_file)
- fprintf (dump_file, "Dropping flag_strict_aliasing on %s:%i\n",
- to->name (), to->order);
+ fprintf (dump_file, "Dropping flag_strict_aliasing on %s\n",
+ to->dump_name ());
DECL_FUNCTION_SPECIFIC_OPTIMIZATION (to->decl)
= build_optimization_node (&opts);
reload_optimization_node = true;
opts.x_flag_errno_math
= opt_for_fn (callee->decl, flag_errno_math);
if (dump_file)
- fprintf (dump_file, "Copying FP flags from %s:%i to %s:%i\n",
- callee->name (), callee->order, to->name (), to->order);
+ fprintf (dump_file, "Copying FP flags from %s to %s\n",
+ callee->dump_name (), to->dump_name ());
DECL_FUNCTION_SPECIFIC_OPTIMIZATION (to->decl)
= build_optimization_node (&opts);
reload_optimization_node = true;
{
if (dump_file)
{
- fprintf (dump_file, " not inlinable: %s/%i -> %s/%i, %s\n",
- xstrdup_for_dump (e->caller->name ()), e->caller->order,
- xstrdup_for_dump (e->callee->name ()), e->callee->order,
+ fprintf (dump_file, " not inlinable: %s -> %s, %s\n",
+ e->caller->dump_name (),
+ e->callee->dump_name (),
cgraph_inline_failed_string (e->inline_failed));
if ((e->inline_failed == CIF_TARGET_OPTION_MISMATCH
|| e->inline_failed == CIF_OPTIMIZATION_MISMATCH)
&& growth > 0)
{
if (dump_file)
- fprintf (dump_file, " will not early inline: %s/%i->%s/%i, "
+ fprintf (dump_file, " will not early inline: %s->%s, "
"call is cold and code would grow by %i\n",
- xstrdup_for_dump (e->caller->name ()),
- e->caller->order,
- xstrdup_for_dump (callee->name ()), callee->order,
+ e->caller->dump_name (),
+ callee->dump_name (),
growth);
want_inline = false;
}
else if (growth > PARAM_VALUE (PARAM_EARLY_INLINING_INSNS))
{
if (dump_file)
- fprintf (dump_file, " will not early inline: %s/%i->%s/%i, "
+ fprintf (dump_file, " will not early inline: %s->%s, "
"growth %i exceeds --param early-inlining-insns\n",
- xstrdup_for_dump (e->caller->name ()),
- e->caller->order,
- xstrdup_for_dump (callee->name ()), callee->order,
+ e->caller->dump_name (),
+ callee->dump_name (),
growth);
want_inline = false;
}
&& growth * (n + 1) > PARAM_VALUE (PARAM_EARLY_INLINING_INSNS))
{
if (dump_file)
- fprintf (dump_file, " will not early inline: %s/%i->%s/%i, "
+ fprintf (dump_file, " will not early inline: %s->%s, "
"growth %i exceeds --param early-inlining-insns "
"divided by number of calls\n",
- xstrdup_for_dump (e->caller->name ()),
- e->caller->order,
- xstrdup_for_dump (callee->name ()), callee->order,
+ e->caller->dump_name (),
+ callee->dump_name (),
growth);
want_inline = false;
}
if (dump)
{
- fprintf (dump_file, " Badness calculation for %s/%i -> %s/%i\n",
- xstrdup_for_dump (edge->caller->name ()),
- edge->caller->order,
- xstrdup_for_dump (callee->name ()),
- edge->callee->order);
+ fprintf (dump_file, " Badness calculation for %s -> %s\n",
+ edge->caller->dump_name (),
+ edge->callee->dump_name ());
fprintf (dump_file, " size growth %i, time %f unspec %f ",
growth,
edge_time.to_double (),
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file,
- " decreasing badness %s/%i -> %s/%i, %f"
- " to %f\n",
- xstrdup_for_dump (edge->caller->name ()),
- edge->caller->order,
- xstrdup_for_dump (edge->callee->name ()),
- edge->callee->order,
+ " decreasing badness %s -> %s, %f to %f\n",
+ edge->caller->dump_name (),
+ edge->callee->dump_name (),
n->get_key ().to_double (),
badness.to_double ());
}
if (dump_file && (dump_flags & TDF_DETAILS))
{
fprintf (dump_file,
- " enqueuing call %s/%i -> %s/%i, badness %f\n",
- xstrdup_for_dump (edge->caller->name ()),
- edge->caller->order,
- xstrdup_for_dump (edge->callee->name ()),
- edge->callee->order,
+ " enqueuing call %s -> %s, badness %f\n",
+ edge->caller->dump_name (),
+ edge->callee->dump_name (),
badness.to_double ());
}
edge->aux = heap->insert (badness, edge);
bool has_speculative = false;
if (dump_file)
- fprintf (dump_file, "Enqueueing calls in %s/%i.\n",
- node->name (), node->order);
+ fprintf (dump_file, "Enqueueing calls in %s.\n", node->dump_name ());
for (edge = node->callees; edge; edge = next)
{
if (dump_file)
{
fprintf (dump_file,
- "\nConsidering %s/%i with %i size\n",
- callee->name (), callee->order,
+ "\nConsidering %s with %i size\n",
+ callee->dump_name (),
ipa_fn_summaries->get (callee)->size);
fprintf (dump_file,
- " to be inlined into %s/%i in %s:%i\n"
+ " to be inlined into %s in %s:%i\n"
" Estimated badness is %f, frequency %.2f.\n",
- edge->caller->name (), edge->caller->order,
+ edge->caller->dump_name (),
edge->call_stmt
&& (LOCATION_LOCUS (gimple_location ((const gimple *)
edge->call_stmt))
if (dump_file)
{
fprintf (dump_file, "Indirect call -> direct call from"
- " other module %s/%i => %s/%i, prob %3.2f\n",
- xstrdup_for_dump (n->name ()), n->order,
- xstrdup_for_dump (n2->name ()), n2->order,
+ " other module %s => %s, prob %3.2f\n",
+ n->dump_name (),
+ n2->dump_name (),
e->indirect_info->common_target_probability
/ (float)REG_BR_PROB_BASE);
}
{
struct cgraph_edge *cs;
- fprintf (f, " Jump functions of caller %s/%i:\n", node->name (),
- node->order);
+ fprintf (f, " Jump functions of caller %s:\n", node->dump_name ());
for (cs = node->callees; cs; cs = cs->next_callee)
{
if (!ipa_edge_args_info_available_for_edge_p (cs))
continue;
- fprintf (f, " callsite %s/%i -> %s/%i : \n",
- xstrdup_for_dump (node->name ()), node->order,
- xstrdup_for_dump (cs->callee->name ()),
- cs->callee->order);
+ fprintf (f, " callsite %s -> %s : \n",
+ node->dump_name (),
+ cs->callee->dump_name ());
ipa_print_node_jump_functions_for_edge (f, cs);
}
{
location_t loc = gimple_location_safe (ie->call_stmt);
dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc,
- "discovered direct call non-invariant "
- "%s/%i\n",
- ie->caller->name (), ie->caller->order);
+ "discovered direct call non-invariant %s\n",
+ ie->caller->dump_name ());
}
return NULL;
}
{
location_t loc = gimple_location_safe (ie->call_stmt);
dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, loc,
- "discovered direct call to non-function in %s/%i, "
+ "discovered direct call to non-function in %s, "
"making it __builtin_unreachable\n",
- ie->caller->name (), ie->caller->order);
+ ie->caller->dump_name ());
}
target = builtin_decl_implicit (BUILT_IN_UNREACHABLE);
{
if (dump_file)
fprintf (dump_file, "ipa-prop: Discovered call to a known target "
- "(%s/%i -> %s/%i) but can not refer to it. Giving up.\n",
- xstrdup_for_dump (ie->caller->name ()),
- ie->caller->order,
- xstrdup_for_dump (ie->callee->name ()),
- ie->callee->order);
+ "(%s -> %s) but can not refer to it. Giving up.\n",
+ ie->caller->dump_name (),
+ ie->callee->dump_name ());
return NULL;
}
callee = cgraph_node::get_create (target);
!= callee->ultimate_alias_target ())
{
if (dump_file)
- fprintf (dump_file, "ipa-prop: Discovered call to a speculative target "
- "(%s/%i -> %s/%i) but the call is already speculated to %s/%i. Giving up.\n",
- xstrdup_for_dump (ie->caller->name ()),
- ie->caller->order,
- xstrdup_for_dump (callee->name ()),
- callee->order,
- xstrdup_for_dump (e2->callee->name ()),
- e2->callee->order);
+ fprintf (dump_file, "ipa-prop: Discovered call to a speculative "
+ "target (%s -> %s) but the call is already "
+ "speculated to %s. Giving up.\n",
+ ie->caller->dump_name (), callee->dump_name (),
+ e2->callee->dump_name ());
}
else
{
if (dump_file)
fprintf (dump_file, "ipa-prop: Discovered call to a speculative target "
- "(%s/%i -> %s/%i) this agree with previous speculation.\n",
- xstrdup_for_dump (ie->caller->name ()),
- ie->caller->order,
- xstrdup_for_dump (callee->name ()),
- callee->order);
+ "(%s -> %s) this agree with previous speculation.\n",
+ ie->caller->dump_name (), callee->dump_name ());
}
return NULL;
}
if (dump_file && !unreachable)
{
fprintf (dump_file, "ipa-prop: Discovered %s call to a %s target "
- "(%s/%i -> %s/%i), for stmt ",
+ "(%s -> %s), for stmt ",
ie->indirect_info->polymorphic ? "a virtual" : "an indirect",
speculative ? "speculative" : "known",
- xstrdup_for_dump (ie->caller->name ()),
- ie->caller->order,
- xstrdup_for_dump (callee->name ()),
- callee->order);
+ ie->caller->dump_name (),
+ callee->dump_name ());
if (ie->call_stmt)
print_gimple_stmt (dump_file, ie->call_stmt, 2, TDF_SLIM);
else
to_del->remove_reference ();
if (dump_file)
- fprintf (dump_file, "ipa-prop: Removed a reference from %s/%i to %s.\n",
- xstrdup_for_dump (origin->caller->name ()),
- origin->caller->order, xstrdup_for_dump (symbol->name ()));
+ fprintf (dump_file, "ipa-prop: Removed a reference from %s to %s.\n",
+ origin->caller->dump_name (), xstrdup_for_dump (symbol->name ()));
return true;
}
{
if (target)
fprintf (dump_file,
- "Type inconsistent devirtualization: %s/%i->%s\n",
- ie->caller->name (), ie->caller->order,
+ "Type inconsistent devirtualization: %s->%s\n",
+ ie->caller->dump_name (),
IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (target)));
else
fprintf (dump_file,
- "No devirtualization target in %s/%i\n",
- ie->caller->name (), ie->caller->order);
+ "No devirtualization target in %s\n",
+ ie->caller->dump_name ());
}
tree new_target = builtin_decl_implicit (BUILT_IN_UNREACHABLE);
cgraph_node::get_create (new_target);
{
if (dump_file)
fprintf (dump_file, "ipa-prop: Removing cloning-created "
- "reference from %s/%i to %s/%i.\n",
- xstrdup_for_dump (new_root->name ()),
- new_root->order,
- xstrdup_for_dump (n->name ()), n->order);
+ "reference from %s to %s.\n",
+ new_root->dump_name (),
+ n->dump_name ());
ref->remove_reference ();
}
}
if (dump_file)
fprintf (dump_file, "ipa-prop: Removing "
"cloning-created reference "
- "from %s/%i to %s/%i.\n",
- xstrdup_for_dump (clone->name ()),
- clone->order,
- xstrdup_for_dump (n->name ()),
- n->order);
+ "from %s to %s.\n",
+ clone->dump_name (),
+ n->dump_name ());
ref->remove_reference ();
}
clone = clone->callers->caller;
if (!node->definition)
return;
info = IPA_NODE_REF (node);
- fprintf (f, " function %s/%i parameter descriptors:\n",
- node->name (), node->order);
+ fprintf (f, " function %s parameter descriptors:\n", node->dump_name ());
count = ipa_get_param_count (info);
for (i = 0; i < count; i++)
{
gcc_checking_assert (current_function_decl);
if (dump_file)
- fprintf (dump_file, "Modification phase of node %s/%i\n",
- node->name (), node->order);
+ fprintf (dump_file, "Modification phase of node %s\n",
+ node->dump_name ());
ipcp_update_bits (node);
ipcp_update_vr (node);
if (dump_file)
{
int flags = flags_from_decl_or_type (node->decl);
- fprintf (dump_file, "Read info for %s/%i ",
- node->name (),
- node->order);
+ fprintf (dump_file, "Read info for %s ", node->dump_name ());
if (flags & ECF_CONST)
fprintf (dump_file, " const");
if (flags & ECF_PURE)
funct_state w_l = get_function_state (w);
if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, " Visiting %s/%i state:%s looping %i\n",
- w->name (),
- w->order,
+ fprintf (dump_file, " Visiting %s state:%s looping %i\n",
+ w->dump_name (),
pure_const_names[w_l->pure_const_state],
w_l->looping);
if (dump_file && (dump_flags & TDF_DETAILS))
{
- fprintf (dump_file,
- " Call to %s/%i",
- e->callee->name (),
- e->callee->order);
+ fprintf (dump_file, " Call to %s",
+ e->callee->dump_name ());
}
if (avail > AVAIL_INTERPOSABLE)
{
l = &get_reference_vars_info (node)->local;
fprintf (dump_file,
- "\nFunction name:%s/%i:",
- node->asm_name (), node->order);
+ "\nFunction name:%s:", node->dump_name ());
fprintf (dump_file, "\n locals read: ");
if (l->statics_read)
EXECUTE_IF_SET_IN_BITMAP (l->statics_read,
{
read_all = true;
if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, " %s/%i -> read all\n",
- node->asm_name (), node->order);
+ fprintf (dump_file, " %s -> read all\n", node->dump_name ());
}
else
{
read_all = true;
write_all = true;
if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, " %s/%i -> read all, write all\n",
- node->asm_name (), node->order);
+ fprintf (dump_file, " %s -> read all, write all\n",
+ node->dump_name ());
}
}
node_g = &node_info->global;
if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "Starting cycle with %s/%i\n",
- node->asm_name (), node->order);
+ fprintf (dump_file, "Starting cycle with %s\n", node->dump_name ());
vec<cgraph_node *> cycle_nodes = ipa_get_nodes_in_cycle (node);
FOR_EACH_VEC_ELT (cycle_nodes, x, w)
{
if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, " Visiting %s/%i\n",
- w->asm_name (), w->order);
+ fprintf (dump_file, " Visiting %s\n", w->dump_asm_name ());
get_read_write_all_from_node (w, read_all, write_all);
if (read_all && write_all)
break;
if (node->alias || !opt_for_fn (node->decl, flag_ipa_reference))
continue;
- fprintf (dump_file,
- "\nFunction name:%s/%i:",
- node->asm_name (), node->order);
+ fprintf (dump_file, "\nFunction name:%s:", node->dump_asm_name ());
ipa_reference_vars_info_t node_info = get_reference_vars_info (node);
ipa_reference_global_vars_info_t node_g = &node_info->global;
ipa_reference_vars_info_t w_ri = get_reference_vars_info (w);
ipa_reference_local_vars_info_t w_l = &w_ri->local;
if (w != node)
- fprintf (dump_file, "\n next cycle: %s/%i ",
- w->asm_name (), w->order);
+ fprintf (dump_file, "\n next cycle: %s ", w->dump_asm_name ());
fprintf (dump_file, "\n locals read: ");
dump_static_vars_set_to_file (dump_file, w_l->statics_read);
fprintf (dump_file, "\n locals written: ");
info->statics_not_written = BITMAP_ALLOC (&optimization_summary_obstack);
if (dump_file)
fprintf (dump_file,
- "\nFunction name:%s/%i:\n static not read:",
- node->asm_name (), node->order);
+ "\nFunction name:%s:\n static not read:",
+ node->dump_asm_name ());
/* Set the statics not read. */
v_count = streamer_read_hwi (ib);
return;
if (symtab->dump_file)
{
- fprintf (symtab->dump_file, "Merging profiles of %s/%i to %s/%i\n",
- xstrdup_for_dump (src->name ()), src->order,
- xstrdup_for_dump (dst->name ()), dst->order);
+ fprintf (symtab->dump_file, "Merging profiles of %s to %s\n",
+ src->dump_name (), dst->dump_name ());
}
dst->count += src->count;
else
locus = UNKNOWN_LOCATION;
dump_printf_loc (MSG_OPTIMIZED_LOCATIONS, locus,
- "devirtualizing call in %s/%i to %s/%i\n",
- edge->caller->name (), edge->caller->order,
- target->name (),
- target->order);
+ "devirtualizing call in %s to %s\n",
+ edge->caller->dump_name (),
+ target->dump_name ());
}
edge = edge->make_direct (target);
if (ipa_fn_summaries)
if (!node->aux)
{
if (file)
- fprintf (file, " %s/%i", node->name (), node->order);
+ fprintf (file, " %s", node->dump_name ());
node->remove ();
changed = true;
}
if (node->definition && !node->alias && !node->thunk.thunk_p)
{
if (file)
- fprintf (file, " %s/%i", node->name (), node->order);
+ fprintf (file, " %s", node->dump_name ());
node->body_removed = true;
node->analyzed = false;
node->definition = false;
while (vnode->iterate_direct_aliases (0, ref))
{
if (file)
- fprintf (file, " %s/%i", ref->referred->name (),
- ref->referred->order);
+ fprintf (file, " %s", ref->referred->dump_name ());
ref->referring->remove ();
}
if (file)
- fprintf (file, " %s/%i", vnode->name (), vnode->order);
+ fprintf (file, " %s", vnode->dump_name ());
vnext = next_variable (vnode);
/* Signal removal to the debug machinery. */
if (! flag_wpa)
if (dump_file)
{
- fprintf (dump_file, "Variable %s/%i is used by single function\n",
- var->name (), var->order);
+ fprintf (dump_file, "Variable %s is used by single function\n",
+ var->dump_name ());
}
var->used_by_single_function = true;
}
+2017-05-23 Martin Liska <mliska@suse.cz>
+
+ * lto-symtab.c (lto_cgraph_replace_node): Use
+ symtab_node::dump_{asm_,}name functions.
+ * lto.c (read_cgraph_and_symbols): Likewise.
+ (do_whole_program_analysis): Likewise.
+
2017-05-23 Martin Liska <mliska@suse.cz>
* lto.c (read_cgraph_and_symbols): Use the renamed function.
if (symtab->dump_file)
{
- fprintf (symtab->dump_file, "Replacing cgraph node %s/%i by %s/%i"
+ fprintf (symtab->dump_file, "Replacing cgraph node %s by %s"
" for symbol %s\n",
- node->name (), node->order,
- prevailing_node->name (),
- prevailing_node->order,
+ node->dump_name (),
+ prevailing_node->dump_name (),
IDENTIFIER_POINTER ((*targetm.asm_out.mangle_assembler_name)
(IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->decl)))));
}
if (dump_file)
fprintf (dump_file,
- "Dropping 0 profile for %s/%i. %s based on calls.\n",
- node->name (), node->order,
- hot ? "Function is hot" : "Function is normal");
+ "Dropping 0 profile for %s. %s based on calls.\n",
+ node->dump_name (),
+ hot ? "Function is hot" : "Function is normal");
/* We only expect to miss profiles for functions that are reached
via non-zero call edges in cases where the function may have
been linked from another module or library (COMDATs and extern
{
if (dump_file)
fprintf (dump_file,
- "Missing counts for called function %s/%i\n",
- node->name (), node->order);
+ "Missing counts for called function %s\n",
+ node->dump_name ());
}
else
- warning (0, "Missing counts for called function %s/%i",
- node->name (), node->order);
+ warning (0, "Missing counts for called function %s",
+ node->dump_name ());
}
profile_status_for_fn (fn)
return lang_hooks.decl_printable_name (decl, 2);
}
+const char *
+symtab_node::get_dump_name (bool asm_name_p) const
+{
+#define EXTRA 16
+ const char *fname = asm_name_p ? asm_name () : name ();
+ unsigned l = strlen (fname);
+
+ char *s = (char *)ggc_internal_cleared_alloc (l + EXTRA);
+ snprintf (s, l + EXTRA, "%s/%d", fname, order);
+
+ return s;
+}
+
+const char *
+symtab_node::dump_name () const
+{
+ return get_dump_name (false);
+}
+
+const char *
+symtab_node::dump_asm_name () const
+{
+ return get_dump_name (true);
+}
+
/* Return ipa reference from this symtab_node to
REFERED_NODE or REFERED_VARPOOL_NODE. USE_TYPE specify type
of the use. */
int i;
for (i = 0; iterate_reference (i, ref); i++)
{
- fprintf (file, "%s/%i (%s)",
- ref->referred->asm_name (),
- ref->referred->order,
+ fprintf (file, "%s (%s)",
+ ref->referred->dump_asm_name (),
ipa_ref_use_name [ref->use]);
if (ref->speculative)
fprintf (file, " (speculative)");
int i;
for (i = 0; iterate_referring(i, ref); i++)
{
- fprintf (file, "%s/%i (%s)",
- ref->referring->asm_name (),
- ref->referring->order,
+ fprintf (file, "%s (%s)",
+ ref->referring->dump_asm_name (),
ipa_ref_use_name [ref->use]);
if (ref->speculative)
fprintf (file, " (speculative)");
"default", "protected", "hidden", "internal"
};
- fprintf (f, "%s/%i (%s)", asm_name (), order, name ());
+ fprintf (f, "%s (%s)", dump_asm_name (), name ());
dump_addr (f, " @", (void *)this);
fprintf (f, "\n Type: %s", symtab_type_names[type]);
fprintf (f, "\n");
if (same_comdat_group)
- fprintf (f, " Same comdat group as: %s/%i\n",
- same_comdat_group->asm_name (),
- same_comdat_group->order);
+ fprintf (f, " Same comdat group as: %s\n",
+ same_comdat_group->dump_asm_name ());
if (next_sharing_asm_name)
fprintf (f, " next sharing asm name: %i\n",
next_sharing_asm_name->order);
push_cfun (DECL_STRUCT_FUNCTION (cs->caller->decl));
if (dump_file)
- fprintf (dump_file, "Adjusting call %s/%i -> %s/%i\n",
- xstrdup_for_dump (cs->caller->name ()),
- cs->caller->order,
- xstrdup_for_dump (cs->callee->name ()),
- cs->callee->order);
+ fprintf (dump_file, "Adjusting call %s -> %s\n",
+ cs->caller->dump_name (), cs->callee->dump_name ());
ipa_modify_call_arguments (cs, cs->call_stmt, *adjustments);
{
if (dump_file)
fprintf (dump_file, "Local profile-id %i conflict"
- " with nodes %s/%i %s/%i\n",
+ " with nodes %s %s\n",
n->profile_id,
- n->name (),
- n->order,
- (*val)->name (),
- (*val)->order);
+ n->dump_name (),
+ (*val)->dump_name ());
n->profile_id = (n->profile_id + 1) & 0x7fffffff;
}
}
{
if (dump_file)
fprintf (dump_file,
- "Node %s/%i has no profile-id"
+ "Node %s has no profile-id"
" (profile feedback missing?)\n",
- n->name (),
- n->order);
+ n->dump_name ());
continue;
}
else if ((val = cgraph_node_map->get (n->profile_id)))
{
if (dump_file)
fprintf (dump_file,
- "Node %s/%i has IP profile-id %i conflict. "
+ "Node %s has IP profile-id %i conflict. "
"Giving up.\n",
- n->name (),
- n->order,
- n->profile_id);
+ n->dump_name (), n->profile_id);
*val = NULL;
continue;
}