tree-inline.h (eni_weights): Add field target_builtin_cost to reflect the cost per...
authorPranav Bhandarkar <pranav.bhandarkar@celunite.com>
Mon, 24 Sep 2007 13:31:25 +0000 (13:31 +0000)
committerRichard Biener <rguenth@gcc.gnu.org>
Mon, 24 Sep 2007 13:31:25 +0000 (13:31 +0000)
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

gcc/ChangeLog
gcc/tree-inline.c
gcc/tree-inline.h

index 15c68ae376cbc06d12afc69d53a22b7bcd9dd2f0..81bdc4c889088bcc206aa48d29c77bab5dc33666 100644 (file)
@@ -1,3 +1,12 @@
+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>
 
        PR middle-end/33472
index 61a7f4e960a29796419c7446f23a25e828cec11b..9c459511b712eab5c892fa0fdfa8f15df0bae2b4 100644 (file)
@@ -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;
index 1fa360ad3459ff1b82ad491a8812db5a7e3eab56..895a0afcbbd64a1eeffe6fbc4c6466e1ff2b3bbb 100644 (file)
@@ -103,6 +103,9 @@ typedef struct eni_weights_d
   /* Cost per call.  */
   unsigned call_cost;
 
+  /* Cost per call to a target specific builtin */
+  unsigned target_builtin_call_cost;
+
   /* Cost of "expensive" div and mod operations.  */
   unsigned div_mod_cost;