PATCH: Properly move vectorizer tests
H.J. Lu
hjl@lucon.org
Mon Sep 3 15:05:00 GMT 2007
This patch:
http://gcc.gnu.org/ml/gcc-patches/2007-08/msg00546.html
tried to move 3 vectorizer tests, but left the old tests as empty
files without adding new tests:
[hjl@gnu-13 testsuite]$ ls -l gcc.dg/vect/no-tree-scev-cprop-vect-iv-1.c gcc.dg/vect/no-scevccp-vect-iv-1.c gcc.dg/vect/no-tree-scev-cprop-vect-iv-2.c gcc.dg/vect/no-scevccp-vect-iv-2.c gcc.dg/vect/no-tree-scev-cprop-vect-iv-3.c gcc.dg/vect/no-scevccp-vect-iv-3.c
ls: gcc.dg/vect/no-scevccp-vect-iv-1.c: No such file or directory
ls: gcc.dg/vect/no-scevccp-vect-iv-2.c: No such file or directory
ls: gcc.dg/vect/no-scevccp-vect-iv-3.c: No such file or directory
-rw-r--r-- 1 hjl hjl 0 Aug 19 13:38 gcc.dg/vect/no-tree-scev-cprop-vect-iv-1.c
-rw-r--r-- 1 hjl hjl 0 Aug 19 13:38 gcc.dg/vect/no-tree-scev-cprop-vect-iv-2.c
-rw-r--r-- 1 hjl hjl 0 Aug 19 13:38 gcc.dg/vect/no-tree-scev-cprop-vect-iv-3.c
[hjl@gnu-13 testsuite]$
This patch will
1. Restore the old tests.
2. Use "svn rename" to properly move them.
I am checking them in as an obvious fix.
H.J.
-----
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.
--- gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-1.c.move 2007-09-03 07:51:30.000000000 -0700
+++ gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-1.c 2007-09-03 07:50:29.000000000 -0700
@@ -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" } } */
--- gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-2.c.move 2007-09-03 07:51:33.000000000 -0700
+++ gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-2.c 2007-09-03 07:50:29.000000000 -0700
@@ -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" } } */
--- gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-3.c.move 2007-09-03 07:51:37.000000000 -0700
+++ gcc/testsuite/gcc.dg/vect/no-scevccp-vect-iv-3.c 2007-09-03 07:50:29.000000000 -0700
@@ -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" } } */
More information about the Gcc-patches
mailing list