OSDN Git Service

2007-09-03 H.J. Lu <hongjiu.lu@intel.com>
authorhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 Sep 2007 15:19:17 +0000 (15:19 +0000)
committerhjl <hjl@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 3 Sep 2007 15:19:17 +0000 (15:19 +0000)
* gcc.dg/vect/no-tree-scev-cprop-vect-iv-1.c: Restored.  Moved
to ...
* gcc.dg/vect/no-scevccp-vect-iv-1.c: New test.
* gcc.dg/vect/no-tree-scev-cprop-vect-iv-2.c: Restored.  Moved
to ...
* gcc.dg/vect/no-scevccp-vect-iv-2.c: New test.
* gcc.dg/vect/no-tree-scev-cprop-vect-iv-3.c: Restored.  Moved
to ...
* gcc.dg/vect/no-scevccp-vect-iv-3.c: New test.

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

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-1.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-2.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-3.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/vect/no-tree-scev-cprop-vect-iv-1.c [deleted file]
gcc/testsuite/gcc.dg/vect/no-tree-scev-cprop-vect-iv-2.c [deleted file]
gcc/testsuite/gcc.dg/vect/no-tree-scev-cprop-vect-iv-3.c [deleted file]

index 66a28e9..4d35334 100644 (file)
@@ -1,3 +1,15 @@
+2007-09-03  H.J. Lu  <hongjiu.lu@intel.com>
+
+       * gcc.dg/vect/no-tree-scev-cprop-vect-iv-1.c: Restored.  Moved
+       to ...
+       * gcc.dg/vect/no-scevccp-vect-iv-1.c: New test.
+       * gcc.dg/vect/no-tree-scev-cprop-vect-iv-2.c: Restored.  Moved
+       to ...
+       * gcc.dg/vect/no-scevccp-vect-iv-2.c: New test.
+       * gcc.dg/vect/no-tree-scev-cprop-vect-iv-3.c: Restored.  Moved
+       to ...
+       * gcc.dg/vect/no-scevccp-vect-iv-3.c: New test.
+
 2007-09-03  Jesper Nilsson  <jesper.nilsson@axis.com>
 
        * gcc.target/cris/builtin_bswap_v3.c: New testcase.
diff --git a/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-1.c b/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-1.c
new file mode 100644 (file)
index 0000000..60c6ff5
--- /dev/null
@@ -0,0 +1,34 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 26
+int main1 (int X)
+{  
+  int s = X;
+  int i;
+
+  /* vectorization of reduction with induction. 
+     Need -fno-tree-scev-cprop or else the loop is eliminated.  */
+  for (i = 0; i < N; i++)
+    s += i;
+
+  return s;
+}
+
+int main (void)
+{ 
+  int s;
+  check_vect ();
+  
+  s = main1 (3);
+  if (s != 328)
+    abort ();
+
+  return 0;
+} 
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-2.c b/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-2.c
new file mode 100644 (file)
index 0000000..5e1c7b8
--- /dev/null
@@ -0,0 +1,49 @@
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 16
+int main1 ()
+{  
+  int arr1[N];
+  int k = 0;
+  int m = 3, i = 0;
+  
+  /* Vectorization of induction that is used after the loop.  
+     Currently vectorizable because scev_ccp disconnects the
+     use-after-the-loop from the iv def inside the loop.  */
+
+   do { 
+        k = k + 2;
+        arr1[i] = k;
+       m = m + k;
+       i++;
+   } while (i < N);
+
+  /* check results:  */
+  for (i = 0; i < N; i++)
+    { 
+      if (arr1[i] != 2+2*i)
+        abort ();
+    }
+
+  return m + k;
+}
+
+int main (void)
+{ 
+  int res;
+
+  check_vect ();
+  
+  res = main1 ();
+  if (res != 32 + 275)
+    abort ();
+
+  return 0;
+} 
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-3.c b/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-3.c
new file mode 100644 (file)
index 0000000..cdfaa6f
--- /dev/null
@@ -0,0 +1,27 @@
+/* { dg-do compile } */
+/* { dg-require-effective-target vect_int } */
+
+#include <stdarg.h>
+#include "tree-vect.h"
+
+#define N 26
+unsigned int main1 ()
+{  
+  unsigned short i;
+  unsigned int intsum = 0;
+
+  /* vectorization of reduction with induction, and widenning sum: 
+     sum shorts into int. 
+     Need -fno-tree-scev-cprop or else the loop is eliminated.  */
+  for (i = 0; i < N; i++)
+    {
+      intsum += i;
+    } 
+
+  return intsum;
+}
+
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_widen_sum_hi_to_si } } } */
+/* { dg-final { scan-tree-dump-times "vect_recog_widen_sum_pattern: detected" 1 "vect" { target vect_widen_sum_hi_to_si } } } */
+/* { dg-final { cleanup-tree-dump "vect" } } */
diff --git a/gcc/testsuite/gcc.dg/vect/no-tree-scev-cprop-vect-iv-1.c b/gcc/testsuite/gcc.dg/vect/no-tree-scev-cprop-vect-iv-1.c
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/gcc/testsuite/gcc.dg/vect/no-tree-scev-cprop-vect-iv-2.c b/gcc/testsuite/gcc.dg/vect/no-tree-scev-cprop-vect-iv-2.c
deleted file mode 100644 (file)
index e69de29..0000000
diff --git a/gcc/testsuite/gcc.dg/vect/no-tree-scev-cprop-vect-iv-3.c b/gcc/testsuite/gcc.dg/vect/no-tree-scev-cprop-vect-iv-3.c
deleted file mode 100644 (file)
index e69de29..0000000