summaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 7daa9d2f513..22604030d4a 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -3521,7 +3521,7 @@ estimate_num_insns (gimple stmt, eni_weights *weights)
case GIMPLE_CALL:
{
tree decl = gimple_call_fndecl (stmt);
- struct cgraph_node *node;
+ struct cgraph_node *node = NULL;
/* Do not special case builtins where we see the body.
This just confuse inliner. */
@@ -3556,7 +3556,7 @@ estimate_num_insns (gimple stmt, eni_weights *weights)
}
}
- cost = weights->call_cost;
+ cost = node ? weights->call_cost : weights->indirect_call_cost;
if (gimple_call_lhs (stmt))
cost += estimate_move_cost (TREE_TYPE (gimple_call_lhs (stmt)));
for (i = 0; i < gimple_call_num_args (stmt); i++)
@@ -3674,6 +3674,7 @@ void
init_inline_once (void)
{
eni_size_weights.call_cost = 1;
+ eni_size_weights.indirect_call_cost = 3;
eni_size_weights.target_builtin_call_cost = 1;
eni_size_weights.div_mod_cost = 1;
eni_size_weights.omp_cost = 40;
@@ -3686,6 +3687,7 @@ init_inline_once (void)
underestimating the cost does less harm than overestimating it, so
we choose a rather small value here. */
eni_time_weights.call_cost = 10;
+ eni_time_weights.indirect_call_cost = 15;
eni_time_weights.target_builtin_call_cost = 1;
eni_time_weights.div_mod_cost = 10;
eni_time_weights.omp_cost = 40;