diff options
Diffstat (limited to 'gcc/ipa-inline-transform.cc')
-rw-r--r-- | gcc/ipa-inline-transform.cc | 30 |
1 files changed, 6 insertions, 24 deletions
diff --git a/gcc/ipa-inline-transform.cc b/gcc/ipa-inline-transform.cc index 46b8e5b..9d759d2 100644 --- a/gcc/ipa-inline-transform.cc +++ b/gcc/ipa-inline-transform.cc @@ -58,27 +58,6 @@ along with GCC; see the file COPYING3. If not see int ncalls_inlined; int nfunctions_inlined; -/* Scale counts of NODE edges by NUM/DEN. */ - -static void -update_noncloned_counts (struct cgraph_node *node, - profile_count num, profile_count den) -{ - struct cgraph_edge *e; - - profile_count::adjust_for_ipa_scaling (&num, &den); - - for (e = node->callees; e; e = e->next_callee) - { - if (!e->inline_failed) - update_noncloned_counts (e->callee, num, den); - e->count = e->count.apply_scale (num, den); - } - for (e = node->indirect_calls; e; e = e->next_callee) - e->count = e->count.apply_scale (num, den); - node->count = node->count.apply_scale (num, den); -} - /* We removed or are going to remove the last call to NODE. Return true if we can and want proactively remove the NODE now. This is important to do, since we want inliner to know when offline @@ -93,7 +72,7 @@ can_remove_node_now_p_1 (struct cgraph_node *node, struct cgraph_edge *e) { cgraph_node *alias = dyn_cast <cgraph_node *> (ref->referring); if ((alias->callers && alias->callers != e) - || !can_remove_node_now_p_1 (alias, e)) + || !can_remove_node_now_p_1 (alias, e)) return false; } /* FIXME: When address is taken of DECL_EXTERNAL function we still @@ -212,7 +191,10 @@ clone_inlined_nodes (struct cgraph_edge *e, bool duplicate, } duplicate = false; e->callee->externally_visible = false; - update_noncloned_counts (e->callee, e->count, e->callee->count); + profile_count num = e->count; + profile_count den = e->callee->count; + profile_count::adjust_for_ipa_scaling (&num, &den); + e->callee->apply_scale (num, den); dump_callgraph_transformation (e->callee, inlining_into, "inlining to"); @@ -349,7 +331,7 @@ inline_call (struct cgraph_edge *e, bool update_original, int estimated_growth = 0; if (! update_overall_summary) estimated_growth = estimate_edge_growth (e); - /* This is used only for assert bellow. */ + /* This is used only for assert below. */ #if 0 bool predicated = inline_edge_summary (e)->predicate != NULL; #endif |