* tree-vect-loop.c (vect_get_single_scalar_iteraion_cost): Skip
authorirar <irar@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 Jul 2010 10:41:25 +0000 (10:41 +0000)
committerirar <irar@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 5 Jul 2010 10:41:25 +0000 (10:41 +0000)
statements that are not vectorized.
* tree-vect-stmts.c (vect_get_load_cost): Update the value stored
in INSIDE_COST.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@161827 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c
gcc/testsuite/gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c
gcc/tree-vect-loop.c
gcc/tree-vect-stmts.c

index 224e73c..0a70431 100644 (file)
@@ -1,3 +1,10 @@
+2010-07-05  Ira Rosen  <irar@il.ibm.com>
+
+       * tree-vect-loop.c (vect_get_single_scalar_iteraion_cost): Skip
+       statements that are not vectorized.
+       * tree-vect-stmts.c (vect_get_load_cost): Update the value stored
+       in INSIDE_COST. 
+
 2010-07-05  Mikael Pettersson  <mikpe@it.uu.se>
 
        PR bootstrap/44820
index 86f3de9..59ac23e 100644 (file)
@@ -1,5 +1,12 @@
 2010-07-05  Ira Rosen  <irar@il.ibm.com>
 
+       * gcc.dg/vect/costmodel/i386/costmodel-fast-math-vect-pr29925.c:
+       Increase loop bound and array size.
+       * gcc.dg/vect/costmodel/x86_64/costmodel-fast-math-vect-pr29925.c:
+       Likewise.
+
+2010-07-05  Ira Rosen  <irar@il.ibm.com>
+
        * gcc.dg/vect/costmodel/ppc/costmodel-vect-31d.c: Remove.
        * gcc.dg/vect/costmodel/ppc/costmodel-vect-76a.c: Increase loop bound.
        * gcc.dg/vect/costmodel/ppc/costmodel-vect-76b.c: Likewise.
index 5627c26..d5c0a1a 100644 (file)
@@ -13,7 +13,7 @@ interp_pitch(float *exc, float *interp, int pitch, int len)
    for (i=0;i<len;i++)
    {
       float tmp = 0;
-      for (k=0;k<7;k++)
+      for (k=0;k<12;k++)
       {
          tmp += exc[i-pitch+k+maxj-6];
       }
@@ -23,7 +23,7 @@ interp_pitch(float *exc, float *interp, int pitch, int len)
 
 int main()
 {
-   float *exc = calloc(126,sizeof(float));
+   float *exc = calloc(136,sizeof(float));
    float *interp = calloc(80,sizeof(float));
    int pitch = -35;
 
index 5627c26..d5c0a1a 100644 (file)
@@ -13,7 +13,7 @@ interp_pitch(float *exc, float *interp, int pitch, int len)
    for (i=0;i<len;i++)
    {
       float tmp = 0;
-      for (k=0;k<7;k++)
+      for (k=0;k<12;k++)
       {
          tmp += exc[i-pitch+k+maxj-6];
       }
@@ -23,7 +23,7 @@ interp_pitch(float *exc, float *interp, int pitch, int len)
 
 int main()
 {
-   float *exc = calloc(126,sizeof(float));
+   float *exc = calloc(136,sizeof(float));
    float *interp = calloc(80,sizeof(float));
    int pitch = -35;
 
index 1285528..22b23a6 100644 (file)
@@ -2046,10 +2046,18 @@ vect_get_single_scalar_iteraion_cost (loop_vec_info loop_vinfo)
       for (si = gsi_start_bb (bb); !gsi_end_p (si); gsi_next (&si))
         {
           gimple stmt = gsi_stmt (si);
+          stmt_vec_info stmt_info = vinfo_for_stmt (stmt);
 
           if (!is_gimple_assign (stmt) && !is_gimple_call (stmt))
             continue;
 
+          /* Skip stmts that are not vectorized inside the loop.  */
+          if (stmt_info
+              && !STMT_VINFO_RELEVANT_P (stmt_info)
+              && (!STMT_VINFO_LIVE_P (stmt_info)
+                  || STMT_VINFO_DEF_TYPE (stmt_info) != vect_reduction_def))
+            continue;
+
           if (STMT_VINFO_DATA_REF (vinfo_for_stmt (stmt)))
             {
               if (DR_IS_READ (STMT_VINFO_DATA_REF (vinfo_for_stmt (stmt))))
index b9da57e..8e921c6 100644 (file)
@@ -826,7 +826,7 @@ vect_get_load_cost (struct data_reference *dr, int ncopies,
     {
     case dr_aligned:
       {
-        inside_cost += ncopies * vect_get_stmt_cost (vector_load); 
+        *inside_cost += ncopies * vect_get_stmt_cost (vector_load); 
 
         if (vect_print_dump_info (REPORT_COST))
           fprintf (vect_dump, "vect_model_load_cost: aligned.");