aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorH.J. Lu <hongjiu.lu@intel.com>2007-09-03 15:19:17 +0000
committerH.J. Lu <hjl@gcc.gnu.org>2007-09-03 08:19:17 -0700
commit7ddb87782d08b109ccf7c137aab6d8b207c87dd9 (patch)
tree96b6915ff83b55ce90d3b312c6df3d15740c786c /gcc
parent9816d522cebd9885103e1ebd997f771c7af6791f (diff)
downloadgcc-7ddb87782d08b109ccf7c137aab6d8b207c87dd9.zip
gcc-7ddb87782d08b109ccf7c137aab6d8b207c87dd9.tar.gz
gcc-7ddb87782d08b109ccf7c137aab6d8b207c87dd9.tar.bz2
no-tree-scev-cprop-vect-iv-1.c: Restored.
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. From-SVN: r128045
Diffstat (limited to 'gcc')
-rw-r--r--gcc/testsuite/ChangeLog12
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-1.c34
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-2.c49
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-3.c27
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-tree-scev-cprop-vect-iv-1.c0
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-tree-scev-cprop-vect-iv-2.c0
-rw-r--r--gcc/testsuite/gcc.dg/vect/no-tree-scev-cprop-vect-iv-3.c0
7 files changed, 122 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 66a28e9..4d35334d 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 0000000..60c6ff5
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-1.c
@@ -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
index 0000000..5e1c7b8
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-2.c
@@ -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
index 0000000..cdfaa6f
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-3.c
@@ -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
index e69de29..0000000
--- a/gcc/testsuite/gcc.dg/vect/no-tree-scev-cprop-vect-iv-1.c
+++ /dev/null
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
index e69de29..0000000
--- a/gcc/testsuite/gcc.dg/vect/no-tree-scev-cprop-vect-iv-2.c
+++ /dev/null
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
index e69de29..0000000
--- a/gcc/testsuite/gcc.dg/vect/no-tree-scev-cprop-vect-iv-3.c
+++ /dev/null