summaryrefslogtreecommitdiff
path: root/gcc/tree-inline.c
diff options
context:
space:
mode:
authorrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-09-24 13:31:25 +0000
committerrguenth <rguenth@138bc75d-0d04-0410-961f-82ee72b054a4>2007-09-24 13:31:25 +0000
commit4a5b1b7cdfea68335a50202078ab716ac751dabf (patch)
tree5ae6ba82a1b1c37487df12609385809595a18d5e /gcc/tree-inline.c
parent89e11285eb627e9ebd4efa5da00dad103921b7f1 (diff)
downloadgcc-4a5b1b7cdfea68335a50202078ab716ac751dabf.tar.gz
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. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@128714 138bc75d-0d04-0410-961f-82ee72b054a4
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 61a7f4e960a..9c459511b71 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;