aboutsummaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorPranav Bhandarkar <pranav.bhandarkar@celunite.com>2007-09-24 13:31:25 +0000
committerRichard Biener <rguenth@gcc.gnu.org>2007-09-24 13:31:25 +0000
commit625a2efbe74a402a8a6121ccef1bb776011051a5 (patch)
tree5ae6ba82a1b1c37487df12609385809595a18d5e /gcc/tree-inline.c
parent548183dbd3b728a6b93a4e8c5397620f386bf618 (diff)
downloadgcc-625a2efbe74a402a8a6121ccef1bb776011051a5.zip
gcc-625a2efbe74a402a8a6121ccef1bb776011051a5.tar.gz
gcc-625a2efbe74a402a8a6121ccef1bb776011051a5.tar.bz2
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
Diffstat (limited to 'gcc/tree-inline.c')
-rw-r--r--gcc/tree-inline.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gcc/tree-inline.c b/gcc/tree-inline.c
index 61a7f4e..9c45951 100644
--- a/gcc/tree-inline.c
+++ b/gcc/tree-inline.c
@@ -2290,7 +2290,11 @@ estimate_num_insns_1 (tree *tp, int *walk_subtrees, void *data)
{
tree decl = get_callee_fndecl (x);
- cost = d->weights->call_cost;
+ if (decl && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_MD)
+ cost = d->weights->target_builtin_call_cost;
+ else
+ cost = d->weights->call_cost;
+
if (decl && DECL_BUILT_IN_CLASS (decl) == BUILT_IN_NORMAL)
switch (DECL_FUNCTION_CODE (decl))
{
@@ -2391,11 +2395,13 @@ void
init_inline_once (void)
{
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.switch_cost = 1;
eni_inlining_weights.omp_cost = 40;
eni_size_weights.call_cost = 1;
+ eni_size_weights.target_builtin_call_cost = 1;
eni_size_weights.div_mod_cost = 1;
eni_size_weights.switch_cost = 10;
eni_size_weights.omp_cost = 40;
@@ -2405,6 +2411,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.target_builtin_call_cost = 10;
eni_time_weights.div_mod_cost = 10;
eni_time_weights.switch_cost = 4;
eni_time_weights.omp_cost = 40;