Commit 625a2efb by Pranav Bhandarkar Committed by Richard Biener

tree-inline.h (eni_weights): Add field target_builtin_cost to reflect the cost…

tree-inline.h (eni_weights): Add field target_builtin_cost to reflect the cost per call to a target specific...

2007-09-24  Pranav Bhandarkar  <pranav.bhandarkar@celunite.com>
        Ramana Radhakrishnan  <ramana@hercules.pun.celunite.com>

        * tree-inline.h (eni_weights): Add field target_builtin_cost to
        reflect the cost per call to a target specific builtin.
        * tree-inline.c (estimate_num_insns_1): If it is a CALL_EXPR for
        * a
        call to a target specific builtin, then use
target_builtin_call_cost.
        (init_inline_once): Initialize target_builtin_call_cost field.

Co-Authored-By: Ramana Radhakrishnan <ramana@hercules.pun.celunite.com>

From-SVN: r128714
parent 548183db
2007-09-24 Pranav Bhandarkar <pranav.bhandarkar@celunite.com>
Ramana Radhakrishnan <ramana@hercules.pun.celunite.com>
* tree-inline.h (eni_weights): Add field target_builtin_cost to
reflect the cost per call to a target specific builtin.
* tree-inline.c (estimate_num_insns_1): If it is a CALL_EXPR for a
call to a target specific builtin, then use target_builtin_call_cost.
(init_inline_once): Initialize target_builtin_call_cost field.
2007-09-24 Kai Tietz <kai.tietz@onevision.com> 2007-09-24 Kai Tietz <kai.tietz@onevision.com>
PR middle-end/33472 PR middle-end/33472
...@@ -2290,7 +2290,11 @@ estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data) ...@@ -2290,7 +2290,11 @@ estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
{ {
tree decl = get_callee_fndecl (x); tree decl = get_callee_fndecl (x);
if (decl && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_MD)
cost = d->weights->target_builtin_call_cost;
else
cost = d->weights->call_cost; cost = d->weights->call_cost;
if (decl && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL) if (decl && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
switch (DECL_FUNCTION_CODE (decl)) switch (DECL_FUNCTION_CODE (decl))
{ {
...@@ -2391,11 +2395,13 @@ void ...@@ -2391,11 +2395,13 @@ void
init_inline_once (void) init_inline_once (void)
{ {
eni_inlining_weights.call_cost = PARAM_VALUE (PARAM_INLINE_CALL_COST); eni_inlining_weights.call_cost = PARAM_VALUE (PARAM_INLINE_CALL_COST);
eni_inlining_weights.target_builtin_call_cost = 1;
eni_inlining_weights.div_mod_cost = 10; eni_inlining_weights.div_mod_cost = 10;
eni_inlining_weights.switch_cost = 1; eni_inlining_weights.switch_cost = 1;
eni_inlining_weights.omp_cost = 40; eni_inlining_weights.omp_cost = 40;
eni_size_weights.call_cost = 1; eni_size_weights.call_cost = 1;
eni_size_weights.target_builtin_call_cost = 1;
eni_size_weights.div_mod_cost = 1; eni_size_weights.div_mod_cost = 1;
eni_size_weights.switch_cost = 10; eni_size_weights.switch_cost = 10;
eni_size_weights.omp_cost = 40; eni_size_weights.omp_cost = 40;
...@@ -2405,6 +2411,7 @@ init_inline_once (void) ...@@ -2405,6 +2411,7 @@ init_inline_once (void)
underestimating the cost does less harm than overestimating it, so underestimating the cost does less harm than overestimating it, so
we choose a rather small value here. */ we choose a rather small value here. */
eni_time_weights.call_cost = 10; eni_time_weights.call_cost = 10;
eni_time_weights.target_builtin_call_cost = 10;
eni_time_weights.div_mod_cost = 10; eni_time_weights.div_mod_cost = 10;
eni_time_weights.switch_cost = 4; eni_time_weights.switch_cost = 4;
eni_time_weights.omp_cost = 40; eni_time_weights.omp_cost = 40;
......
...@@ -103,6 +103,9 @@ typedef struct eni_weights_d ...@@ -103,6 +103,9 @@ typedef struct eni_weights_d
/* Cost per call. */ /* Cost per call. */
unsigned call_cost; unsigned call_cost;
/* Cost per call to a target specific builtin */
unsigned target_builtin_call_cost;
/* Cost of "expensive" div and mod operations. */ /* Cost of "expensive" div and mod operations. */
unsigned div_mod_cost; unsigned div_mod_cost;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment