OSDN Git Service

PR tree-optimization/39675
authorirar <irar@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 20 Apr 2009 11:26:18 +0000 (11:26 +0000)
committerirar <irar@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 20 Apr 2009 11:26:18 +0000 (11:26 +0000)
* tree-vect-loop.c (vect_transform_loop): Remove currently redundant
check of the return code of vect_schedule_slp. Check that stmt_vec_info
still exists for the statement, before checking its vectorization type.

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

gcc/ChangeLog
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c [new file with mode: 0644]
gcc/tree-vect-loop.c

index ebb4d37..7d962a6 100644 (file)
@@ -1,3 +1,10 @@
+2009-04-20  Ira Rosen  <irar@il.ibm.com>
+
+       PR tree-optimization/39675
+       * tree-vect-loop.c (vect_transform_loop): Remove currently redundant 
+       check of the return code of vect_schedule_slp. Check that stmt_vec_info
+       still exists for the statement, before checking its vectorization type.
+
 2009-04-20  Michael Matz  <matz@suse.de>
 
        * Makefile.in (generated_files): Take out $(simple_generated_c).
index df0281d..96442c5 100644 (file)
@@ -1,3 +1,8 @@
+2009-04-20  Ira Rosen  <irar@il.ibm.com>
+
+       PR tree-optimization/39675
+       * gcc.dg/vect/O3-pr39675-2.c: New test.
+
 2009-04-20  Eric Botcazou  <ebotcazou@adacore.com>
 
        * gnat.dg/rep_clause3.adb: New test.
diff --git a/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c b/gcc/testsuite/gcc.dg/vect/O3-pr39675-2.c
new file mode 100644 (file)
index 0000000..7d6af7b
--- /dev/null
@@ -0,0 +1,32 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#define N 128
+
+int out[N*4], out2[N], in[N*4];
+
+void
+foo ()
+{
+  int i, a0, a1, a2, a3;
+
+  for (i = 0; i < N; i++) 
+    { 
+      a0 = in[i*4];
+      a1 = in[i*4 + 1];
+      a2 = in[i*4 + 2];
+      a3 = in[i*4 + 3];
+
+      out[i*4] = a0;
+      out[i*4 + 1] = a1;
+      out[i*4 + 2] = a2;
+      out[i*4 + 3] = a3;
+
+      out2[i] = a0;
+    }
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"  { target vect_strided_wide } } } */
+/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target vect_strided_wide } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
+  
index d78fa99..ee54cac 100644 (file)
@@ -3528,20 +3528,11 @@ vect_transform_loop (loop_vec_info loop_vinfo)
                  if (vect_print_dump_info (REPORT_DETAILS))
                    fprintf (vect_dump, "=== scheduling SLP instances ===");
 
-                 is_store = vect_schedule_slp (loop_vinfo);
-
-                 /* IS_STORE is true if STMT is a store. Stores cannot be of
-                    hybrid SLP type. They are removed in
-                    vect_schedule_slp_instance and their vinfo is destroyed. */
-                 if (is_store)
-                   {
-                     gsi_next (&si);
-                     continue;
-                   }
+                 vect_schedule_slp (loop_vinfo);
                }
 
              /* Hybrid SLP stmts must be vectorized in addition to SLP.  */
-             if (PURE_SLP_STMT (stmt_info))
+             if (!vinfo_for_stmt (stmt) || PURE_SLP_STMT (stmt_info))
                {
                  gsi_next (&si);
                  continue;