summaryrefslogtreecommitdiff
path: root/gcc/ipa-cp.c
diff options
context:
space:
mode:
authorhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-25 21:59:24 +0000
committerhubicka <hubicka@138bc75d-0d04-0410-961f-82ee72b054a4>2009-05-25 21:59:24 +0000
commit973433026ad181d0f53092ee4e0debc11827da2a (patch)
treecd788cef35d8a937c0812e48a90dc01d40ef1a51 /gcc/ipa-cp.c
parentd8021dea8c5ab8c689c7d60a28d4e2778c2996cb (diff)
downloadgcc-973433026ad181d0f53092ee4e0debc11827da2a.tar.gz
* cgraph.c (dump_cgraph_node): Dump size/time/benefit.
* cgraph.h (struct inline_summary): New filed self_wize, size_inlining_benefit, self_time and time_inlining_benefit. (struct cgraph_global_info): Replace insns by time ans size fields. * ipa-cp (ipcp_cloning_candidate_p): Base estimate on size (ipcp_estimate_growth, ipcp_insert_stage): Likewise. (ipcp_update_callgraph): Do not touch function bodies. * ipa-inline.c: Include except.h (MAX_TIME): New constant. (overall_insns): Remove. (leaf_node_p): New. (overall_size, max_benefit): New static variables. (cgraph_estimate_time_after_inlining): New function. (cgraph_estimate_size_after_inlining): Rewrite using benefits. (cgraph_clone_inlined_nodes): Update size. (cgraph_mark_inline_edge): Update size. (cgraph_estimate_growth): Use size info. (cgraph_check_inline_limits): Check size. (cgraph_default_inline_p): Likewise. (cgraph_edge_badness): Compute badness based on benefit and size cost. (cgraph_decide_recursive_inlining): Check size. (cgraph_decide_inlining_of_small_function): Update size; dump sizes and times. (cgraph_decide_inlining): Likewise. (cgraph_decide_inlining_incrementally): Likewise; honor PARAM_EARLY_INLINING_INSNS. (likely_eliminated_by_inlining_p): New predicate. (estimate_function_body_sizes): New function. (compute_inline_parameters): Use it. * except.c (must_not_throw_labels): New function. * except.h (must_not_throw_labels): Declare. * tree-inline.c (init_inline_once): Kill inlining_weigths * tree-ssa-structalias.c: Avoid uninitialized warning. * params.def (PARAM_MAX_INLINE_INSNS_SINGLE): Reduce to 300. (PARAM_MAX_INLINE_INSNS_AUTO): Reduce to 60. (PARAM_INLINE_CALL_COST): Remove. (PARAM_EARLY_INLINING_INSNS): New. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@147852 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/ipa-cp.c')
-rw-r--r--gcc/ipa-cp.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/gcc/ipa-cp.c b/gcc/ipa-cp.c
index 2b63806172b..581a88a1b6c 100644
--- a/gcc/ipa-cp.c
+++ b/gcc/ipa-cp.c
@@ -396,7 +396,7 @@ ipcp_cloning_candidate_p (struct cgraph_node *node)
cgraph_node_name (node));
return false;
}
- if (node->local.inline_summary.self_insns < n_calls)
+ if (node->local.inline_summary.self_size < n_calls)
{
if (dump_file)
fprintf (dump_file, "Considering %s for cloning; code would shrink.\n",
@@ -837,10 +837,7 @@ ipcp_update_callgraph (void)
{
next = cs->next_caller;
if (!ipcp_node_is_clone (cs->caller) && ipcp_need_redirect_p (cs))
- {
- cgraph_redirect_edge_callee (cs, orig_node);
- gimple_call_set_fndecl (cs->call_stmt, orig_node->decl);
- }
+ cgraph_redirect_edge_callee (cs, orig_node);
}
}
}
@@ -916,7 +913,7 @@ ipcp_estimate_growth (struct cgraph_node *node)
call site. Precise cost is dificult to get, as our size metric counts
constants and moves as free. Generally we are looking for cases that
small function is called very many times. */
- growth = node->local.inline_summary.self_insns
+ growth = node->local.inline_summary.self_size
- removable_args * redirectable_node_callers;
if (growth < 0)
return 0;
@@ -956,7 +953,7 @@ ipcp_estimate_cloning_cost (struct cgraph_node *node)
cost /= freq_sum * 1000 / REG_BR_PROB_BASE + 1;
if (dump_file)
fprintf (dump_file, "Cost of versioning %s is %i, (size: %i, freq: %i)\n",
- cgraph_node_name (node), cost, node->local.inline_summary.self_insns,
+ cgraph_node_name (node), cost, node->local.inline_summary.self_size,
freq_sum);
return cost + 1;
}
@@ -1012,7 +1009,7 @@ ipcp_insert_stage (void)
{
if (node->count > max_count)
max_count = node->count;
- overall_size += node->local.inline_summary.self_insns;
+ overall_size += node->local.inline_summary.self_size;
}
max_new_size = overall_size;