re PR tree-optimization/40992 (cunroll ignoring asm size)
authorAndrew Pinski <andrew_pinski@playstation.sony.com>
Mon, 5 Oct 2009 17:46:35 +0000 (17:46 +0000)
committerAndrew Pinski <pinskia@gcc.gnu.org>
Mon, 5 Oct 2009 17:46:35 +0000 (10:46 -0700)
2009-10-05  Andrew Pinski  <andrew_pinski@playstation.sony.com>

        PR tree-opt/40992
        * final.c (asm_str_count): Split out from asm_insn_count.
        * rtl.h (asm_str_count): New prototype.
        * tree-inline (estimate_num_insns) <case GIMPLE_ASM>: Call
        asm_str_count.

From-SVN: r152458

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

index 20000c9..096db82 100644 (file)
@@ -1,3 +1,11 @@
+2009-10-05  Andrew Pinski  <andrew_pinski@playstation.sony.com>
+
+       PR tree-opt/40992
+       * final.c (asm_str_count): Split out from asm_insn_count.
+       * rtl.h (asm_str_count): New prototype.
+       * tree-inline (estimate_num_insns) <case GIMPLE_ASM>: Call
+       asm_str_count.
+
 2009-10-05  Sriraman Tallam  <tmsriram@google.com>
 
        * doc/plugins.texi: Change plugin_pass to register_pass_info.
index 78a698b..f121da1 100644 (file)
@@ -1399,13 +1399,23 @@ static int
 asm_insn_count (rtx body)
 {
   const char *templ;
-  int count = 1;
 
   if (GET_CODE (body) == ASM_INPUT)
     templ = XSTR (body, 0);
   else
     templ = decode_asm_operands (body, NULL, NULL, NULL, NULL, NULL);
 
+  return asm_str_count (templ);
+}
+#endif
+
+/* Return the number of machine instructions likely to be generated for the
+   inline-asm template. */
+int
+asm_str_count (const char *templ)
+{
+  int count = 1;
+  
   if (!*templ)
     return 0;
 
@@ -1416,7 +1426,6 @@ asm_insn_count (rtx body)
 
   return count;
 }
-#endif
 \f
 /* ??? This is probably the wrong place for these.  */
 /* Structure recording the mapping from source file and directory
index d415ba4..a7be009 100644 (file)
--- a/gcc/rtl.h
+++ b/gcc/rtl.h
@@ -2424,6 +2424,7 @@ extern void simplify_using_condition (rtx, rtx *, struct bitmap_head_def *);
 
 /* In final.c  */
 extern unsigned int compute_alignments (void);
+extern int asm_str_count (const char *templ);
 \f
 struct rtl_hooks
 {
index e38da6d..91ed023 100644 (file)
@@ -3346,7 +3346,7 @@ estimate_num_insns (gimple stmt, eni_weights *weights)
       return 0;
 
     case GIMPLE_ASM:
-      return 1;
+      return asm_str_count (gimple_asm_string (stmt));
 
     case GIMPLE_RESX:
       /* This is either going to be an external function call with one