+2013-11-18 Trevor Saunders <tsaunders@mozilla.com>
+
+ * cgraph.h (symtab_node_asm_name): Rename to symtab_node::asm_name.
+ (symtab_node_name): Rename to symtab_node::name.
+ (cgraph_node_asm_name): Remove.
+ (varpool_node_asm_name): Remove.
+ * cgraph.c cgraphclones.c cgraphunit.c ipa-cp.c ipa-devirt.c
+ ipa-inline-analysis.c ipa-inline-transform.c ipa-inline.c
+ ipa-profile.c ipa-prop.c ipa-pure-const.c ipa-ref.c ipa-reference.c
+ ipa-utils.c ipa.c symtab.c tree-inline.c tree-sra.c
+ tree-ssa-structalias.c value-prof.c varpool.c Adjust.
+
2013-11-18 Kyrylo Tkachov <kyrylo.tkachov@arm.com>
* config/arm/aarch-cost-tables.h (cortexa53_extra_costs): New table.
if (dump_file)
fprintf (dump_file, "Introduced new external node "
"(%s/%i) and turned into root of the clone tree.\n",
- xstrdup (cgraph_node_name (node)), node->order);
+ xstrdup (node->name ()), node->order);
}
else if (dump_file)
fprintf (dump_file, "Introduced new external node "
- "(%s/%i).\n", xstrdup (cgraph_node_name (node)),
+ "(%s/%i).\n", xstrdup (node->name ()),
node->order);
return node;
}
{
fprintf (dump_file, "Indirect call -> speculative call"
" %s/%i => %s/%i\n",
- xstrdup (cgraph_node_name (n)), n->order,
- xstrdup (cgraph_node_name (n2)), n2->order);
+ xstrdup (n->name ()), n->order,
+ xstrdup (n2->name ()), n2->order);
}
e->speculative = true;
e2 = cgraph_create_edge (n, n2, e->call_stmt, direct_count, direct_frequency);
{
fprintf (dump_file, "Speculative indirect call %s/%i => %s/%i has "
"turned out to have contradicting known target ",
- xstrdup (cgraph_node_name (edge->caller)), edge->caller->order,
- xstrdup (cgraph_node_name (e2->callee)), e2->callee->order);
+ xstrdup (edge->caller->name ()), edge->caller->order,
+ xstrdup (e2->callee->name ()), e2->callee->order);
print_generic_expr (dump_file, callee_decl, 0);
fprintf (dump_file, "\n");
}
else
{
fprintf (dump_file, "Removing speculative call %s/%i => %s/%i\n",
- xstrdup (cgraph_node_name (edge->caller)), edge->caller->order,
- xstrdup (cgraph_node_name (e2->callee)), e2->callee->order);
+ xstrdup (edge->caller->name ()), edge->caller->order,
+ xstrdup (e2->callee->name ()), e2->callee->order);
}
}
}
if (dump_file)
fprintf (dump_file, "Not expanding speculative call of %s/%i -> %s/%i\n"
"Type mismatch.\n",
- xstrdup (cgraph_node_name (e->caller)),
+ xstrdup (e->caller->name ()),
e->caller->order,
- xstrdup (cgraph_node_name (e->callee)),
+ xstrdup (e->callee->name ()),
e->callee->order);
e = cgraph_resolve_speculation (e, NULL);
/* We are producing the final function body and will throw away the
fprintf (dump_file,
"Expanding speculative call of %s/%i -> %s/%i count:"
HOST_WIDEST_INT_PRINT_DEC"\n",
- xstrdup (cgraph_node_name (e->caller)),
+ xstrdup (e->caller->name ()),
e->caller->order,
- xstrdup (cgraph_node_name (e->callee)),
+ xstrdup (e->callee->name ()),
e->callee->order,
(HOST_WIDEST_INT)e->count);
gcc_assert (e2->speculative);
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file, "updating call of %s/%i -> %s/%i: ",
- xstrdup (cgraph_node_name (e->caller)), e->caller->order,
- xstrdup (cgraph_node_name (e->callee)), e->callee->order);
+ xstrdup (e->caller->name ()), e->caller->order,
+ xstrdup (e->callee->name ()), e->callee->order);
print_gimple_stmt (cgraph_dump_file, e->call_stmt, 0, dump_flags);
if (e->callee->clone.combined_args_to_skip)
{
if (node->global.inlined_to)
fprintf (f, " Function %s/%i is inline copy in %s/%i\n",
- xstrdup (cgraph_node_name (node)),
+ xstrdup (node->name ()),
node->order,
- xstrdup (cgraph_node_name (node->global.inlined_to)),
+ xstrdup (node->global.inlined_to->name ()),
node->global.inlined_to->order);
if (node->clone_of)
fprintf (f, " Clone of %s/%i\n",
- cgraph_node_asm_name (node->clone_of),
+ node->clone_of->asm_name (),
node->clone_of->order);
if (cgraph_function_flags_ready)
fprintf (f, " Availability: %s\n",
fprintf (f, " executed "HOST_WIDEST_INT_PRINT_DEC"x",
(HOST_WIDEST_INT)node->count);
if (node->origin)
- fprintf (f, " nested in: %s", cgraph_node_asm_name (node->origin));
+ fprintf (f, " nested in: %s", node->origin->asm_name ());
if (gimple_has_body_p (node->decl))
fprintf (f, " body");
if (node->process)
for (edge = node->callers; edge; edge = edge->next_caller)
{
- fprintf (f, "%s/%i ", cgraph_node_asm_name (edge->caller),
+ fprintf (f, "%s/%i ", edge->caller->asm_name (),
edge->caller->order);
if (edge->count)
fprintf (f, "("HOST_WIDEST_INT_PRINT_DEC"x) ",
fprintf (f, "\n Calls: ");
for (edge = node->callees; edge; edge = edge->next_callee)
{
- fprintf (f, "%s/%i ", cgraph_node_asm_name (edge->callee),
+ fprintf (f, "%s/%i ", edge->callee->asm_name (),
edge->callee->order);
if (edge->speculative)
fprintf (f, "(speculative) ");
if (e->aux)
{
error ("aux field set for edge %s->%s",
- identifier_to_locale (cgraph_node_name (e->caller)),
- identifier_to_locale (cgraph_node_name (e->callee)));
+ identifier_to_locale (e->caller->name ()),
+ identifier_to_locale (e->callee->name ()));
error_found = true;
}
if (node->count < 0)
if (e->aux)
{
error ("aux field set for indirect edge from %s",
- identifier_to_locale (cgraph_node_name (e->caller)));
+ identifier_to_locale (e->caller->name ()));
error_found = true;
}
if (!e->indirect_unknown_callee
{
error ("An indirect edge from %s is not marked as indirect or has "
"associated indirect_info, the corresponding statement is: ",
- identifier_to_locale (cgraph_node_name (e->caller)));
+ identifier_to_locale (e->caller->name ()));
cgraph_debug_gimple_stmt (this_cfun, e->call_stmt);
error_found = true;
}
if (!e->aux)
{
error ("edge %s->%s has no corresponding call_stmt",
- identifier_to_locale (cgraph_node_name (e->caller)),
- identifier_to_locale (cgraph_node_name (e->callee)));
+ identifier_to_locale (e->caller->name ()),
+ identifier_to_locale (e->callee->name ()));
cgraph_debug_gimple_stmt (this_cfun, e->call_stmt);
error_found = true;
}
if (!e->aux && !e->speculative)
{
error ("an indirect edge from %s has no corresponding call_stmt",
- identifier_to_locale (cgraph_node_name (e->caller)));
+ identifier_to_locale (e->caller->name ()));
cgraph_debug_gimple_stmt (this_cfun, e->call_stmt);
error_found = true;
}
symtab_node
{
public:
+ /* Return name. */
+ const char *name () const;
+
+ /* Return asm name. */
+ const char * asm_name () const;
+
/* Type of the symbol. */
ENUM_BITFIELD (symtab_type) type : 8;
void symtab_remove_node (symtab_node *);
symtab_node *symtab_get_node (const_tree);
symtab_node *symtab_node_for_asm (const_tree asmname);
-const char * symtab_node_asm_name (symtab_node *);
-const char * symtab_node_name (symtab_node *);
void symtab_insert_node_to_hashtable (symtab_node *);
void symtab_add_to_same_comdat_group (symtab_node *, symtab_node *);
void symtab_dissolve_same_comdat_group_list (symtab_node *node);
return varpool (symtab_get_node (decl));
}
-/* Return asm name of cgraph node. */
-static inline const char *
-cgraph_node_asm_name (struct cgraph_node *node)
-{
- return symtab_node_asm_name (node);
-}
-
-/* Return asm name of varpool node. */
-static inline const char *
-varpool_node_asm_name (struct varpool_node *node)
-{
- return symtab_node_asm_name (node);
-}
-
-/* Return name of cgraph node. */
-static inline const char *
-cgraph_node_name (struct cgraph_node *node)
-{
- return symtab_node_name (node);
-}
-
-/* Return name of varpool node. */
-static inline const char *
-varpool_node_name (struct varpool_node *node)
-{
- return symtab_node_name (node);
-}
-
/* Walk all symbols. */
#define FOR_EACH_SYMBOL(node) \
for ((node) = symtab_nodes; (node); (node) = (node)->next)
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file, "cloning %s to %s\n",
- xstrdup (cgraph_node_name (node->clone_of)),
- xstrdup (cgraph_node_name (node)));
+ xstrdup (node->clone_of->name ()),
+ xstrdup (node->name ()));
if (node->clone.tree_map)
{
unsigned int i;
fprintf (cgraph_dump_file, "Trivially needed symbols:");
changed = true;
if (cgraph_dump_file)
- fprintf (cgraph_dump_file, " %s", symtab_node_asm_name (node));
+ fprintf (cgraph_dump_file, " %s", node->asm_name ());
if (!changed && cgraph_dump_file)
fprintf (cgraph_dump_file, "\n");
}
if (!node->aux && !referred_to_p (node))
{
if (cgraph_dump_file)
- fprintf (cgraph_dump_file, " %s", symtab_node_name (node));
+ fprintf (cgraph_dump_file, " %s", node->name ());
symtab_remove_node (node);
continue;
}
def to_string (self):
result = '<cgraph_node* 0x%x' % long(self.gdbval)
if long(self.gdbval):
- # symtab_node_name calls lang_hooks.decl_printable_name
+ # symtab_node::name calls lang_hooks.decl_printable_name
# default implementation (lhd_decl_printable_name) is:
# return IDENTIFIER_POINTER (DECL_NAME (decl));
tree_decl = Tree(self.gdbval['decl'])
struct ipa_node_params *info;
info = IPA_NODE_REF (node);
- fprintf (f, " Node: %s/%i:\n", cgraph_node_name (node),
+ fprintf (f, " Node: %s/%i:\n", node->name (),
node->order);
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",
- cgraph_node_name (node), node->order, reason);
+ node->name (), node->order, reason);
node->local.versionable = (reason == NULL);
}
if (dump_file)
fprintf (dump_file, "Not considering %s for cloning; "
"-fipa-cp-clone disabled.\n",
- cgraph_node_name (node));
+ node->name ());
return false;
}
if (dump_file)
fprintf (dump_file, "Not considering %s for cloning; "
"optimizing it for size.\n",
- cgraph_node_name (node));
+ node->name ());
return false;
}
{
if (dump_file)
fprintf (dump_file, "Considering %s for cloning; code might shrink.\n",
- cgraph_node_name (node));
+ node->name ());
return true;
}
if (dump_file)
fprintf (dump_file, "Considering %s for cloning; "
"usually called directly.\n",
- cgraph_node_name (node));
+ node->name ());
return true;
}
}
{
if (dump_file)
fprintf (dump_file, "Not considering %s for cloning; no hot calls.\n",
- cgraph_node_name (node));
+ node->name ());
return false;
}
if (dump_file)
fprintf (dump_file, "Considering %s for cloning.\n",
- cgraph_node_name (node));
+ node->name ());
return true;
}
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",
- cgraph_node_name (node), node->order,
+ node->name (), node->order,
disable ? "BOTTOM" : "VARIABLE");
}
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "\nEstimating effects for %s/%i, base_time: %i.\n",
- cgraph_node_name (node), node->order, base_time);
+ node->name (), node->order, base_time);
always_const = gather_context_independent_values (info, &known_csts,
&known_binfos, &known_aggs,
for (cs = new_node->callees; cs ; cs = cs->next_callee)
fprintf (dump_file, " edge to %s has count "
HOST_WIDE_INT_PRINT_DEC "\n",
- cgraph_node_name (cs->callee), (HOST_WIDE_INT) cs->count);
+ cs->callee->name (), (HOST_WIDE_INT) cs->count);
fprintf (dump_file, " setting count of the original node to "
HOST_WIDE_INT_PRINT_DEC "\n", (HOST_WIDE_INT) orig_node->count);
for (cs = orig_node->callees; cs ; cs = cs->next_callee)
fprintf (dump_file, " edge to %s is left with "
HOST_WIDE_INT_PRINT_DEC "\n",
- cgraph_node_name (cs->callee), (HOST_WIDE_INT) cs->count);
+ cs->callee->name (), (HOST_WIDE_INT) cs->count);
}
/* After a specialized NEW_NODE version of ORIG_NODE has been created, update
fprintf (dump_file, " Problem: node %s/%i has too low count "
HOST_WIDE_INT_PRINT_DEC " while the sum of incoming "
"counts is " HOST_WIDE_INT_PRINT_DEC "\n",
- cgraph_node_name (orig_node), orig_node->order,
+ orig_node->name (), orig_node->order,
(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",
- cgraph_node_name (new_node), new_node->order);
+ new_node->name (), new_node->order);
if (aggvals)
ipa_dump_agg_replacement_values (dump_file, aggvals);
}
if (dump_file)
fprintf (dump_file, " - adding an extra caller %s/%i"
" of %s/%i\n",
- xstrdup (cgraph_node_name (cs->caller)),
+ xstrdup (cs->caller->name ()),
cs->caller->order,
- xstrdup (cgraph_node_name (val->spec_node)),
+ xstrdup (val->spec_node->name ()),
val->spec_node->order);
cgraph_redirect_edge_callee (cs, val->spec_node);
if (dump_file)
fprintf (dump_file, " Creating a specialized node of %s/%i.\n",
- cgraph_node_name (node), node->order);
+ node->name (), node->order);
callers = gather_edges_for_value (val, caller_count);
kv = known_csts.copy ();
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "\nEvaluating opportunities for %s/%i.\n",
- cgraph_node_name (node), node->order);
+ node->name (), node->order);
gather_context_independent_values (info, &known_csts, &known_binfos,
info->do_clone_for_all_contexts ? &known_aggs
if (dump_file)
fprintf (dump_file, " - Creating a specialized node of %s/%i "
- "for all known contexts.\n", cgraph_node_name (node),
+ "for all known contexts.\n", node->name (),
node->order);
callers = collect_callers_of_node (node);
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",
- cgraph_node_name (v), v->order);
+ v->name (), v->order);
}
}
(int)otr_token,
final ? " (full list)" : " (partial list, may call to other unit)");
for (i = 0; i < targets.length (); i++)
- fprintf (f, " %s/%i", cgraph_node_name (targets[i]),
+ fprintf (f, " %s/%i", targets[i]->name (),
targets[i]->order);
fprintf (f, "\n");
}
bool update = false;
if (dump_file && n->indirect_calls)
fprintf (dump_file, "\n\nProcesing function %s/%i\n",
- cgraph_node_name (n), n->order);
+ n->name (), n->order);
for (e = n->indirect_calls; e; e = e->next_callee)
if (e->indirect_info->polymorphic)
{
if (dump_file)
fprintf (dump_file,
"Speculatively devirtualizing call in %s/%i to %s/%i\n",
- cgraph_node_name (n), n->order,
- cgraph_node_name (likely_target),
+ n->name (), n->order,
+ likely_target->name (),
likely_target->order);
if (!symtab_can_be_discarded (likely_target))
{
fprintf (f,
"%*s%s/%i %s\n%*s loop depth:%2i freq:%4i size:%2i"
" time: %2i callee size:%2i stack:%2i",
- indent, "", cgraph_node_name (callee), callee->order,
+ indent, "", callee->name (), callee->order,
!edge->inline_failed
? "inlined" : cgraph_inline_failed_string (edge-> inline_failed),
indent, "", es->loop_depth, edge->frequency,
struct inline_summary *s = inline_summary (node);
size_time_entry *e;
int i;
- fprintf (f, "Inline summary for %s/%i", cgraph_node_name (node),
+ fprintf (f, "Inline summary for %s/%i", node->name (),
node->order);
if (DECL_DISREGARD_INLINE_LIMITS (node->decl))
fprintf (f, " always_inline");
if (dump_file)
fprintf (dump_file, "\nAnalyzing function body size: %s\n",
- cgraph_node_name (node));
+ node->name ());
/* When we run into maximal number of entries, we assign everything to the
constant truth case. Be sure to have it in list. */
{
bool found = false;
fprintf (dump_file, " Estimating body: %s/%i\n"
- " Known to be false: ", cgraph_node_name (node),
+ " Known to be false: ", node->name (),
node->order);
for (i = predicate_not_inlined_condition;
if (dump_file)
fprintf (dump_file, "\nAnalyzing function: %s/%u\n",
- cgraph_node_name (node), node->order);
+ node->name (), node->order);
if (optimize && !node->thunk.thunk_p)
inline_indirect_intraprocedural_analysis (node);
compute_inline_parameters (node, false);
if (dump_file)
fprintf (dump_file, "\nSaving body of %s for later reuse\n",
- cgraph_node_name (node));
+ node->name ());
gcc_assert (node == cgraph_get_node (node->decl));
if (dump_file)
{
fprintf (dump_file, " not inlinable: %s/%i -> %s/%i, %s\n",
- xstrdup (cgraph_node_name (e->caller)), e->caller->order,
- xstrdup (cgraph_node_name (e->callee)), e->callee->order,
+ xstrdup (e->caller->name ()), e->caller->order,
+ xstrdup (e->callee->name ()), e->callee->order,
cgraph_inline_failed_string (e->inline_failed));
}
}
if (dump_file)
fprintf (dump_file, " will not early inline: %s/%i->%s/%i, "
"call is cold and code would grow by %i\n",
- xstrdup (cgraph_node_name (e->caller)),
+ xstrdup (e->caller->name ()),
e->caller->order,
- xstrdup (cgraph_node_name (callee)), callee->order,
+ xstrdup (callee->name ()), callee->order,
growth);
want_inline = false;
}
if (dump_file)
fprintf (dump_file, " will not early inline: %s/%i->%s/%i, "
"growth %i exceeds --param early-inlining-insns\n",
- xstrdup (cgraph_node_name (e->caller)),
+ xstrdup (e->caller->name ()),
e->caller->order,
- xstrdup (cgraph_node_name (callee)), callee->order,
+ xstrdup (callee->name ()), callee->order,
growth);
want_inline = false;
}
fprintf (dump_file, " will not early inline: %s/%i->%s/%i, "
"growth %i exceeds --param early-inlining-insns "
"divided by number of calls\n",
- xstrdup (cgraph_node_name (e->caller)),
+ xstrdup (e->caller->name ()),
e->caller->order,
- xstrdup (cgraph_node_name (callee)), callee->order,
+ xstrdup (callee->name ()), callee->order,
growth);
want_inline = false;
}
if (dump)
{
fprintf (dump_file, " Badness calculation for %s/%i -> %s/%i\n",
- xstrdup (cgraph_node_name (edge->caller)),
+ xstrdup (edge->caller->name ()),
edge->caller->order,
- xstrdup (cgraph_node_name (callee)),
+ xstrdup (callee->name ()),
edge->callee->order);
fprintf (dump_file, " size growth %i, time %i ",
growth,
{
fprintf (dump_file,
" decreasing badness %s/%i -> %s/%i, %i to %i\n",
- xstrdup (cgraph_node_name (edge->caller)),
+ xstrdup (edge->caller->name ()),
edge->caller->order,
- xstrdup (cgraph_node_name (edge->callee)),
+ xstrdup (edge->callee->name ()),
edge->callee->order,
(int)n->key,
badness);
{
fprintf (dump_file,
" enqueuing call %s/%i -> %s/%i, badness %i\n",
- xstrdup (cgraph_node_name (edge->caller)),
+ xstrdup (edge->caller->name ()),
edge->caller->order,
- xstrdup (cgraph_node_name (edge->callee)),
+ xstrdup (edge->callee->name ()),
edge->callee->order,
badness);
}
if (dump_file)
fprintf (dump_file,
" Performing recursive inlining on %s\n",
- cgraph_node_name (node));
+ node->name ());
/* Do the inlining and update list of recursive call during process. */
while (!fibheap_empty (heap))
if (dump_file)
fprintf (dump_file, "Enqueueing calls in %s/%i.\n",
- cgraph_node_name (node), node->order);
+ node->name (), node->order);
for (edge = node->callees; edge; edge = next)
{
{
fprintf (dump_file,
"\nConsidering %s/%i with %i size\n",
- cgraph_node_name (callee), callee->order,
+ callee->name (), callee->order,
inline_summary (callee)->size);
fprintf (dump_file,
" to be inlined into %s/%i in %s:%i\n"
" Estimated growth after inlined into all is %+i insns.\n"
" Estimated badness is %i, frequency %.2f.\n",
- cgraph_node_name (edge->caller), edge->caller->order,
+ edge->caller->name (), edge->caller->order,
flag_wpa ? "unknown"
: gimple_filename ((const_gimple) edge->call_stmt),
flag_wpa ? -1
fprintf (dump_file,
" Inlined into %s which now has time %i and size %i,"
"net change of %+i.\n",
- cgraph_node_name (edge->caller),
+ edge->caller->name (),
inline_summary (edge->caller)->time,
inline_summary (edge->caller)->size,
overall_size - old_size);
if (dump_file)
fprintf (dump_file,
"Not inlining %s into %s to avoid cycle.\n",
- xstrdup (cgraph_node_name (callee)),
- xstrdup (cgraph_node_name (e->caller)));
+ xstrdup (callee->name ()),
+ xstrdup (e->caller->name ()));
e->inline_failed = CIF_RECURSIVE_INLINING;
continue;
}
recursing through the original node if the node was cloned. */
if (dump_file)
fprintf (dump_file, " Inlining %s into %s.\n",
- xstrdup (cgraph_node_name (callee)),
- xstrdup (cgraph_node_name (e->caller)));
+ xstrdup (callee->name ()),
+ xstrdup (e->caller->name ()));
orig_callee = callee;
inline_call (e, true, NULL, NULL, false);
if (e->callee != orig_callee)
{
fprintf (dump_file,
"\nInlining %s size %i.\n",
- cgraph_node_name (node),
+ node->name (),
inline_summary (node)->size);
fprintf (dump_file,
" Called once from %s %i insns.\n",
- cgraph_node_name (node->callers->caller),
+ node->callers->caller->name (),
inline_summary (node->callers->caller)->size);
}
if (dump_file)
fprintf (dump_file,
" Inlined into %s which now has %i size\n",
- cgraph_node_name (caller),
+ caller->name (),
inline_summary (caller)->size);
if (!(*num_calls)--)
{
{
if (dump_file)
fprintf (dump_file,
- "Flattening %s\n", cgraph_node_name (node));
+ "Flattening %s\n", node->name ());
flatten_function (node, false);
}
}
{
if (dump_file)
fprintf (dump_file, " Not inlining recursive call to %s.\n",
- cgraph_node_name (e->callee));
+ e->callee->name ());
e->inline_failed = CIF_RECURSIVE_INLINING;
continue;
}
if (dump_file)
fprintf (dump_file, " Inlining %s into %s (always_inline).\n",
- xstrdup (cgraph_node_name (e->callee)),
- xstrdup (cgraph_node_name (e->caller)));
+ xstrdup (e->callee->name ()),
+ xstrdup (e->caller->name ()));
inline_call (e, true, NULL, NULL, false);
inlined = true;
}
if (dump_file)
fprintf (dump_file, "Considering inline candidate %s.\n",
- cgraph_node_name (callee));
+ callee->name ());
if (!can_early_inline_edge_p (e))
continue;
if (dump_file)
fprintf (dump_file, " Inlining %s into %s.\n",
- xstrdup (cgraph_node_name (callee)),
- xstrdup (cgraph_node_name (e->caller)));
+ xstrdup (callee->name ()),
+ xstrdup (e->caller->name ()));
inline_call (e, true, NULL, NULL, true);
inlined = true;
}
all calls in it. */
if (dump_file)
fprintf (dump_file,
- "Flattening %s\n", cgraph_node_name (node));
+ "Flattening %s\n", node->name ());
flatten_function (node, true);
inlined = true;
}
case NODE_FREQUENCY_EXECUTED_ONCE:
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, " Called by %s that is executed once\n",
- cgraph_node_name (edge->caller));
+ edge->caller->name ());
d->maybe_unlikely_executed = false;
if (inline_edge_summary (edge)->loop_depth)
{
case NODE_FREQUENCY_NORMAL:
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, " Called by %s that is normal or hot\n",
- cgraph_node_name (edge->caller));
+ edge->caller->name ());
d->maybe_unlikely_executed = false;
d->maybe_executed_once = false;
break;
return false;
gcc_assert (node->analyzed);
if (dump_file && (dump_flags & TDF_DETAILS))
- fprintf (dump_file, "Processing frequency %s\n", cgraph_node_name (node));
+ fprintf (dump_file, "Processing frequency %s\n", node->name ());
cgraph_for_node_and_aliases (node, ipa_propagate_frequency_1, &d, true);
node->only_called_at_startup = true;
if (dump_file)
fprintf (dump_file, "Node %s promoted to only called at startup.\n",
- cgraph_node_name (node));
+ node->name ());
changed = true;
}
if ((d.only_called_at_exit && !d.only_called_at_startup)
node->only_called_at_exit = true;
if (dump_file)
fprintf (dump_file, "Node %s promoted to only called at exit.\n",
- cgraph_node_name (node));
+ node->name ());
changed = true;
}
{
if (dump_file)
fprintf (dump_file, "Node %s promoted to hot.\n",
- cgraph_node_name (node));
+ node->name ());
node->frequency = NODE_FREQUENCY_HOT;
return true;
}
{
if (dump_file)
fprintf (dump_file, "Node %s reduced to normal.\n",
- cgraph_node_name (node));
+ node->name ());
node->frequency = NODE_FREQUENCY_NORMAL;
changed = true;
}
node->frequency = NODE_FREQUENCY_UNLIKELY_EXECUTED;
if (dump_file)
fprintf (dump_file, "Node %s promoted to unlikely executed.\n",
- cgraph_node_name (node));
+ node->name ());
changed = true;
}
else if (d.maybe_executed_once && node->frequency != NODE_FREQUENCY_EXECUTED_ONCE)
node->frequency = NODE_FREQUENCY_EXECUTED_ONCE;
if (dump_file)
fprintf (dump_file, "Node %s promoted to executed once.\n",
- cgraph_node_name (node));
+ node->name ());
changed = true;
}
return changed;
{
fprintf (dump_file, "Indirect call -> direct call from"
" other module %s/%i => %s/%i, prob %3.2f\n",
- xstrdup (cgraph_node_name (n)), n->order,
- xstrdup (cgraph_node_name (n2)), n2->order,
+ xstrdup (n->name ()), n->order,
+ xstrdup (n2->name ()), n2->order,
e->indirect_info->common_target_probability
/ (float)REG_BR_PROB_BASE);
}
{
struct cgraph_edge *cs;
- fprintf (f, " Jump functions of caller %s/%i:\n", cgraph_node_name (node),
+ fprintf (f, " Jump functions of caller %s/%i:\n", node->name (),
node->order);
for (cs = node->callees; cs; cs = cs->next_callee)
{
continue;
fprintf (f, " callsite %s/%i -> %s/%i : \n",
- xstrdup (cgraph_node_name (node)), node->order,
- xstrdup (cgraph_node_name (cs->callee)),
+ xstrdup (node->name ()), node->order,
+ xstrdup (cs->callee->name ()),
cs->callee->order);
ipa_print_node_jump_functions_for_edge (f, cs);
}
if (dump_file)
fprintf (dump_file, "ipa-prop: Discovered direct call to non-function"
" in %s/%i, making it unreachable.\n",
- cgraph_node_name (ie->caller), ie->caller->order);
+ ie->caller->name (), ie->caller->order);
target = builtin_decl_implicit (BUILT_IN_UNREACHABLE);
callee = cgraph_get_create_node (target);
unreachable = true;
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 (cgraph_node_name (ie->caller)),
+ xstrdup (ie->caller->name ()),
ie->caller->order,
- xstrdup (cgraph_node_name (ie->callee)),
+ xstrdup (ie->callee->name ()),
ie->callee->order);
return NULL;
}
fprintf (dump_file, "ipa-prop: Discovered %s call to a known target "
"(%s/%i -> %s/%i), for stmt ",
ie->indirect_info->polymorphic ? "a virtual" : "an indirect",
- xstrdup (cgraph_node_name (ie->caller)),
+ xstrdup (ie->caller->name ()),
ie->caller->order,
- xstrdup (cgraph_node_name (callee)),
+ xstrdup (callee->name ()),
callee->order);
if (ie->call_stmt)
print_gimple_stmt (dump_file, ie->call_stmt, 2, TDF_SLIM);
ipa_remove_reference (to_del);
if (dump_file)
fprintf (dump_file, "ipa-prop: Removed a reference from %s/%i to %s.\n",
- xstrdup (cgraph_node_name (origin->caller)),
- origin->caller->order, xstrdup (symtab_node_name (symbol)));
+ xstrdup (origin->caller->name ()),
+ origin->caller->order, xstrdup (symbol->name ()));
return true;
}
if (dump_file)
fprintf (dump_file, "ipa-prop: Removing cloning-created "
"reference from %s/%i to %s/%i.\n",
- xstrdup (cgraph_node_name (new_root)),
+ xstrdup (new_root->name ()),
new_root->order,
- xstrdup (cgraph_node_name (n)), n->order);
+ xstrdup (n->name ()), n->order);
ipa_remove_reference (ref);
}
}
fprintf (dump_file, "ipa-prop: Removing "
"cloning-created reference "
"from %s/%i to %s/%i.\n",
- xstrdup (cgraph_node_name (clone)),
+ xstrdup (clone->name ()),
clone->order,
- xstrdup (cgraph_node_name (n)),
+ xstrdup (n->name ()),
n->order);
ipa_remove_reference (ref);
}
return;
info = IPA_NODE_REF (node);
fprintf (f, " function %s/%i parameter descriptors:\n",
- cgraph_node_name (node), node->order);
+ node->name (), node->order);
count = ipa_get_param_count (info);
for (i = 0; i < count; i++)
{
if (dump_file)
fprintf (dump_file, "Modification phase of node %s/%i\n",
- cgraph_node_name (node), node->order);
+ node->name (), node->order);
aggval = ipa_get_agg_replacements_for_node (node);
if (!aggval)
if (dump_file)
{
fprintf (dump_file, "\n\n local analysis of %s\n ",
- cgraph_node_name (fn));
+ fn->name ());
}
push_cfun (DECL_STRUCT_FUNCTION (decl));
{
int flags = flags_from_decl_or_type (node->decl);
fprintf (dump_file, "Read info for %s/%i ",
- cgraph_node_name (node),
+ node->name (),
node->order);
if (flags & ECF_CONST)
fprintf (dump_file, " const");
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",
- cgraph_node_name (w),
+ w->name (),
w->order,
pure_const_names[w_l->pure_const_state],
w_l->looping);
{
fprintf (dump_file,
" Call to %s/%i",
- cgraph_node_name (e->callee),
+ e->callee->name (),
e->callee->order);
}
if (avail > AVAIL_OVERWRITABLE)
if (dump_file)
fprintf (dump_file, "Function found to be %sconst: %s\n",
this_looping ? "looping " : "",
- cgraph_node_name (w));
+ w->name ());
}
cgraph_set_const_flag (w, true, this_looping);
break;
if (dump_file)
fprintf (dump_file, "Function found to be %spure: %s\n",
this_looping ? "looping " : "",
- cgraph_node_name (w));
+ w->name ());
}
cgraph_set_pure_flag (w, true, this_looping);
break;
cgraph_set_nothrow_flag (w, true);
if (dump_file)
fprintf (dump_file, "Function found to be nothrow: %s\n",
- cgraph_node_name (w));
+ w->name ());
}
else if (can_throw && !TREE_NOTHROW (w->decl))
w_l->can_throw = true;
for (i = 0; ipa_ref_list_reference_iterate (list, i, ref); i++)
{
fprintf (file, "%s/%i (%s)",
- symtab_node_asm_name (ref->referred),
+ ref->referred->asm_name (),
ref->referred->order,
ipa_ref_use_name [ref->use]);
if (ref->speculative)
for (i = 0; ipa_ref_list_referring_iterate (list, i, ref); i++)
{
fprintf (file, "%s/%i (%s)",
- symtab_node_asm_name (ref->referring),
+ ref->referring->asm_name (),
ref->referring->order,
ipa_ref_use_name [ref->use]);
if (ref->speculative)
l = &get_reference_vars_info (node)->local;
fprintf (dump_file,
"\nFunction name:%s/%i:",
- cgraph_node_asm_name (node), node->order);
+ node->asm_name (), node->order);
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",
- cgraph_node_asm_name (node), node->order);
+ node->asm_name (), node->order);
}
else
{
write_all = true;
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, " %s/%i -> read all, write all\n",
- cgraph_node_asm_name (node), node->order);
+ node->asm_name (), node->order);
}
}
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, "Starting cycle with %s/%i\n",
- cgraph_node_asm_name (node), node->order);
+ node->asm_name (), node->order);
vec<cgraph_node_ptr> cycle_nodes = ipa_get_nodes_in_cycle (node);
{
if (dump_file && (dump_flags & TDF_DETAILS))
fprintf (dump_file, " Visiting %s/%i\n",
- cgraph_node_asm_name (w), w->order);
+ w->asm_name (), w->order);
get_read_write_all_from_node (w, read_all, write_all);
if (read_all && write_all)
break;
fprintf (dump_file,
"\nFunction name:%s/%i:",
- cgraph_node_asm_name (node), node->order);
+ node->asm_name (), node->order);
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_local_vars_info_t w_l = &w_ri->local;
if (w != node)
fprintf (dump_file, "\n next cycle: %s/%i ",
- cgraph_node_asm_name (w), w->order);
+ w->asm_name (), w->order);
fprintf (dump_file, "\n locals read: ");
dump_static_vars_set_to_file (dump_file, w_l->statics_read);
fprintf (dump_file, "\n locals written: ");
if (dump_file)
fprintf (dump_file,
"\nFunction name:%s/%i:\n static not read:",
- cgraph_node_asm_name (node), node->order);
+ node->asm_name (), node->order);
/* Set the statics not read. */
v_count = streamer_read_hwi (ib);
for (iter = csi_start (set); !csi_end_p (iter); csi_next (&iter))
{
struct cgraph_node *node = csi_node (iter);
- fprintf (f, " %s/%i", cgraph_node_name (node), node->order);
+ fprintf (f, " %s/%i", node->name (), node->order);
}
fprintf (f, "\n");
}
for (iter = vsi_start (set); !vsi_end_p (iter); vsi_next (&iter))
{
struct varpool_node *node = vsi_node (iter);
- fprintf (f, " %s", varpool_node_name (node));
+ fprintf (f, " %s", node->name ());
}
fprintf (f, "\n");
}
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file, "Merging profiles of %s/%i to %s/%i\n",
- xstrdup (cgraph_node_name (src)), src->order,
- xstrdup (cgraph_node_name (dst)), dst->order);
+ xstrdup (src->name ()), src->order,
+ xstrdup (dst->name ()), dst->order);
}
dst->count += src->count;
if (dump_file)
fprintf (dump_file,
"Devirtualizing call in %s/%i to %s/%i\n",
- cgraph_node_name (edge->caller),
+ edge->caller->name (),
edge->caller->order,
- cgraph_node_name (target), target->order);
+ target->name (), target->order);
edge = cgraph_make_edge_direct (edge, target);
if (!inline_summary_vec && edge->call_stmt)
cgraph_redirect_edge_call_stmt_to_callee (edge);
if (!node->aux)
{
if (file)
- fprintf (file, " %s", cgraph_node_name (node));
+ fprintf (file, " %s", node->name ());
cgraph_remove_node (node);
changed = true;
}
if (node->definition)
{
if (file)
- fprintf (file, " %s", cgraph_node_name (node));
+ fprintf (file, " %s", node->name ());
node->analyzed = false;
node->definition = false;
node->cpp_implicit_alias = false;
&& (!flag_ltrans || !DECL_EXTERNAL (vnode->decl)))
{
if (file)
- fprintf (file, " %s", varpool_node_name (vnode));
+ fprintf (file, " %s", vnode->name ());
varpool_remove_node (vnode);
changed = true;
}
if (vnode->definition)
{
if (file)
- fprintf (file, " %s", varpool_node_name (vnode));
+ fprintf (file, " %s", vnode->name ());
changed = true;
}
vnode->definition = false;
if (!cgraph_for_node_and_aliases (node, has_addr_references_p, NULL, true))
{
if (file)
- fprintf (file, " %s", cgraph_node_name (node));
+ fprintf (file, " %s", node->name ());
node->address_taken = false;
changed = true;
if (cgraph_local_node_p (node))
if (TREE_ADDRESSABLE (vnode->decl) && !address_taken)
{
if (dump_file)
- fprintf (dump_file, " %s (addressable)", varpool_node_name (vnode));
+ fprintf (dump_file, " %s (addressable)", vnode->name ());
TREE_ADDRESSABLE (vnode->decl) = 0;
}
if (!TREE_READONLY (vnode->decl) && !address_taken && !written
&& DECL_SECTION_NAME (vnode->decl) == NULL)
{
if (dump_file)
- fprintf (dump_file, " %s (read-only)", varpool_node_name (vnode));
+ fprintf (dump_file, " %s (read-only)", vnode->name ());
TREE_READONLY (vnode->decl) = 1;
}
}
fprintf (dump_file, "\nMarking local functions:");
FOR_EACH_DEFINED_FUNCTION (node)
if (node->local.local)
- fprintf (dump_file, " %s", cgraph_node_name (node));
+ fprintf (dump_file, " %s", node->name ());
fprintf (dump_file, "\n\n");
fprintf (dump_file, "\nMarking externally visible functions:");
FOR_EACH_DEFINED_FUNCTION (node)
if (node->externally_visible)
- fprintf (dump_file, " %s", cgraph_node_name (node));
+ fprintf (dump_file, " %s", node->name ());
fprintf (dump_file, "\n\n");
fprintf (dump_file, "\nMarking externally visible variables:");
FOR_EACH_DEFINED_VARIABLE (vnode)
if (vnode->externally_visible)
- fprintf (dump_file, " %s", varpool_node_name (vnode));
+ fprintf (dump_file, " %s", vnode->name ());
fprintf (dump_file, "\n\n");
}
cgraph_function_flags_ready = true;
+2013-11-18 Trevor Saunders <tsaunders@mozilla.com>
+
+ * lto-partition.c lto-symtab.c lto.c Adjust.
+
2013-10-31 David Malcolm <dmalcolm@redhat.com>
Automated part of renaming of symtab_node_base to symtab_node.
node->in_other_partition = 1;
if (cgraph_dump_file)
fprintf (cgraph_dump_file, "Symbol node %s now used in multiple partitions\n",
- symtab_node_name (node));
+ node->name ());
}
node->aux = (void *)((size_t)node->aux + 1);
if (get_symbol_class (node) != SYMBOL_PARTITION
|| symbol_partitioned_p (node))
continue;
- partition = new_partition (symtab_node_asm_name (node));
+ partition = new_partition (node->asm_name ());
add_symbol_to_partition (partition, node);
npartitions++;
}
if (cgraph_dump_file)
fprintf (cgraph_dump_file, "Step %i: added %s/%i, size %i, cost %i/%i "
"best %i/%i, step %i\n", i,
- cgraph_node_name (order[i]), order[i]->order,
+ order[i]->name (), order[i]->order,
partition->insns, cost, internal,
best_cost, best_internal, best_i);
/* Partition is too large, unwind into step when best cost was reached and
DECL_VISIBILITY_SPECIFIED (node->decl) = true;
if (cgraph_dump_file)
fprintf (cgraph_dump_file,
- "Promoting as hidden: %s\n", symtab_node_name (node));
+ "Promoting as hidden: %s\n", node->name ());
}
/* Return true if NODE needs named section even if it won't land in the partition
if (cgraph_dump_file)
fprintf (cgraph_dump_file,
- "Renaming statics with asm name: %s\n", symtab_node_name (node));
+ "Renaming statics with asm name: %s\n", node->name ());
/* Assign every symbol in the set that shares the same ASM name an unique
mangled name. */
{
fprintf (cgraph_dump_file, "Replacing cgraph node %s/%i by %s/%i"
" for symbol %s\n",
- cgraph_node_name (node), node->order,
- cgraph_node_name (prevailing_node),
+ node->name (), node->order,
+ prevailing_node->name (),
prevailing_node->order,
IDENTIFIER_POINTER ((*targetm.asm_out.mangle_assembler_name)
(IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->decl)))));
if (cgraph_dump_file)
{
fprintf (cgraph_dump_file, "Merging nodes for %s. Candidates:\n",
- symtab_node_asm_name (first));
+ first->asm_name ());
for (e = first; e; e = e->next_sharing_asm_name)
if (TREE_PUBLIC (e->decl))
dump_symtab_node (cgraph_dump_file, e);
lsei_next_in_partition (&lsei))
{
symtab_node *node = lsei_node (lsei);
- fprintf (cgraph_dump_file, "%s ", symtab_node_asm_name (node));
+ fprintf (cgraph_dump_file, "%s ", node->asm_name ());
}
fprintf (cgraph_dump_file, "\n Symbols in boundary: ");
for (lsei = lsei_start (part->encoder); !lsei_end_p (lsei);
symtab_node *node = lsei_node (lsei);
if (!lto_symtab_encoder_in_partition_p (part->encoder, node))
{
- fprintf (cgraph_dump_file, "%s ", symtab_node_asm_name (node));
+ fprintf (cgraph_dump_file, "%s ", node->asm_name ());
cgraph_node *cnode = dyn_cast <cgraph_node> (node);
if (cnode
&& lto_symtab_encoder_encode_body_p (part->encoder, cnode))
if (dump_file)
fprintf (dump_file,
"Dropping 0 profile for %s/%i. %s based on calls.\n",
- cgraph_node_name (node), node->order,
+ node->name (), node->order,
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
if (dump_file)
fprintf (dump_file,
"Missing counts for called function %s/%i\n",
- cgraph_node_name (node), node->order);
+ node->name (), node->order);
}
else
warning (0, "Missing counts for called function %s/%i",
- cgraph_node_name (node), node->order);
+ node->name (), node->order);
}
profile_status_for_function (fn)
is unknown go with identifier name. */
const char *
-symtab_node_asm_name (symtab_node *node)
+symtab_node::asm_name () const
{
- if (!DECL_ASSEMBLER_NAME_SET_P (node->decl))
- return lang_hooks.decl_printable_name (node->decl, 2);
- return IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (node->decl));
+ if (!DECL_ASSEMBLER_NAME_SET_P (decl))
+ return lang_hooks.decl_printable_name (decl, 2);
+ return IDENTIFIER_POINTER (DECL_ASSEMBLER_NAME (decl));
}
/* Return printable identifier name. */
const char *
-symtab_node_name (symtab_node *node)
+symtab_node::name () const
{
- return lang_hooks.decl_printable_name (node->decl, 2);
+ return lang_hooks.decl_printable_name (decl, 2);
}
static const char * const symtab_type_names[] = {"symbol", "function", "variable"};
};
fprintf (f, "%s/%i (%s)",
- symtab_node_asm_name (node),
+ node->asm_name (),
node->order,
- symtab_node_name (node));
+ node->name ());
dump_addr (f, " @", (void *)node);
fprintf (f, "\n Type: %s", symtab_type_names[node->type]);
if (node->same_comdat_group)
fprintf (f, " Same comdat group as: %s/%i\n",
- symtab_node_asm_name (node->same_comdat_group),
+ node->same_comdat_group->asm_name (),
node->same_comdat_group->order);
if (node->next_sharing_asm_name)
fprintf (f, " next sharing asm name: %i\n",
if (dump_file)
{
fprintf (dump_file, "Created new direct edge to %s\n",
- cgraph_node_name (dest));
+ dest->name ());
}
}
if (dump_file)
fprintf (dump_file, "Adjusting call %s/%i -> %s/%i\n",
- xstrdup (cgraph_node_name (cs->caller)),
+ xstrdup (cs->caller->name ()),
cs->caller->order,
- xstrdup (cgraph_node_name (cs->callee)),
+ xstrdup (cs->callee->name ()),
cs->callee->order);
ipa_modify_call_arguments (cs, cs->call_stmt, *adjustments);
if (dump_file)
{
fprintf (dump_file,
- "Generating constraints for %s", cgraph_node_name (node));
+ "Generating constraints for %s", node->name ());
if (DECL_ASSEMBLER_NAME_SET_P (node->decl))
fprintf (dump_file, " (%s)",
IDENTIFIER_POINTER
fprintf (dump_file, "Local profile-id %i conflict"
" with nodes %s/%i %s/%i\n",
n->profile_id,
- cgraph_node_name (n),
+ n->name (),
n->order,
- symtab_node_name (*(symtab_node **)val),
+ (*(symtab_node **)val)->name (),
(*(symtab_node **)val)->order);
n->profile_id = (n->profile_id + 1) & 0x7fffffff;
}
fprintf (dump_file,
"Node %s/%i has no profile-id"
" (profile feedback missing?)\n",
- cgraph_node_name (n),
+ n->name (),
n->order);
continue;
}
fprintf (dump_file,
"Node %s/%i has IP profile-id %i conflict. "
"Giving up.\n",
- cgraph_node_name (n),
+ n->name (),
n->order,
n->profile_id);
*val = NULL;
if (dump_enabled_p ())
dump_printf_loc (MSG_MISSED_OPTIMIZATION, locus,
"Skipping target %s with mismatching types for icall\n",
- cgraph_node_name (target));
+ target->name ());
return false;
}
{
enqueue_node (node, &first);
if (cgraph_dump_file)
- fprintf (cgraph_dump_file, " %s", varpool_node_asm_name (node));
+ fprintf (cgraph_dump_file, " %s", node->asm_name ());
}
}
while (first != (struct varpool_node *)(void *)1)
if (!node->aux)
{
if (cgraph_dump_file)
- fprintf (cgraph_dump_file, " %s", varpool_node_asm_name (node));
+ fprintf (cgraph_dump_file, " %s", node->asm_name ());
varpool_remove_node (node);
}
}