diff options
-rw-r--r-- | gcc/testsuite/ChangeLog | 18 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/pr16105.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/pr20122.c | 19 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-37.c | 21 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-74.c | 11 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-75.c | 8 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-76.c | 9 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-77.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-78.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-79.c | 20 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/vect/vect-97.c | 16 |
11 files changed, 77 insertions, 62 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 367ffae4c4b..6b46fe2dc00 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,21 @@ +2005-09-20 Dorit Nuzman <dorit@il.ibm.com> + + * gcc.dg/vect/pr16105.c: Replace "aligned types" with regular types. + No longer vectorizable on vect_no_align targets. + * gcc.dg/vect/pr20122.c: Likewise. + * gcc.dg/vect/vect-74.c: Likewise. + * gcc.dg/vect/vect-75.c: Likewise. + * gcc.dg/vect/vect-76.c: Likewise. + + * gcc.dg/vect/vect-37.c: Replace "aligned types" with regular types. + Will not be vectorizable on vect_no_align targets once aliasing issues + are resolved. + * gcc.dg/vect/vect-79.c: Likewise. + + * gcc.dg/vect/vect-77.c: Replace "aligned types" with regular types. + * gcc.dg/vect/vect-78.c: Likewise. + * gcc.dg/vect/vect-97.c: Likewise. + 2005-09-19 Steven Bosscher <stevenb@suse.de> * gcc.dg/pr23943.c: New test. diff --git a/gcc/testsuite/gcc.dg/vect/pr16105.c b/gcc/testsuite/gcc.dg/vect/pr16105.c index d413c61abd7..ddc669cf2d8 100644 --- a/gcc/testsuite/gcc.dg/vect/pr16105.c +++ b/gcc/testsuite/gcc.dg/vect/pr16105.c @@ -2,12 +2,11 @@ /* { dg-require-effective-target vect_float } */ #define VECTOR_SIZE 512 -typedef float afloat __attribute__ ((__aligned__(16))); -extern void check(const afloat * __restrict__ v); +extern void check(const float * __restrict__ v); -void square(const afloat * __restrict__ a, - afloat * __restrict__ out) +void square(const float * __restrict__ a, + float * __restrict__ out) { unsigned int i; for (i = 0; i < VECTOR_SIZE; i++) { @@ -18,5 +17,5 @@ void square(const afloat * __restrict__ a, check(out); } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect"} } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/pr20122.c b/gcc/testsuite/gcc.dg/vect/pr20122.c index a713e5e1fa8..ebb9f42db0c 100644 --- a/gcc/testsuite/gcc.dg/vect/pr20122.c +++ b/gcc/testsuite/gcc.dg/vect/pr20122.c @@ -3,15 +3,12 @@ #include <stdarg.h> #include "tree-vect.h" -typedef short ashort __attribute__ ((__aligned__(16))); -ashort Kernshort[24]; -static void VecBug(ashort Kernel[8][24]) __attribute__((noinline)); -static void VecBug(ashort Kernel[8][24]); -static void VecBug2(ashort Kernel[8][24]) __attribute__((noinline)); -static void VecBug2(ashort Kernel[8][24]); +short Kernshort[24] __attribute__ ((__aligned__(16))); +static void VecBug(short Kernel[8][24]) __attribute__((noinline)); +static void VecBug2(short Kernel[8][24]) __attribute__((noinline)); /* Not vectorizable: Kernel may alias Kernshort - a global array. */ -static void VecBug(ashort Kernel[8][24]) +static void VecBug(short Kernel[8][24]) { int k,i; for (k = 0; k<8; k++) @@ -20,10 +17,10 @@ static void VecBug(ashort Kernel[8][24]) } /* Vectorizable: Kernshort2 is local. */ -static void VecBug2(ashort Kernel[8][24]) +static void VecBug2(short Kernel[8][24]) { int k,i; - ashort Kernshort2[24]; + short Kernshort2[24] __attribute__ ((__aligned__(16))); for (k = 0; k<8; k++) for (i = 0; i<24; i++) Kernshort2[i] = Kernel[k][i]; @@ -38,7 +35,7 @@ int main (int argc, char **argv) { check_vect (); - ashort Kernel[8][24]; + short Kernel[8][24] __attribute__ ((__aligned__(16))); int k,i; for (k = 0; k<8; k++) @@ -52,5 +49,5 @@ int main (int argc, char **argv) } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { xfail vect_no_align} } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-37.c b/gcc/testsuite/gcc.dg/vect/vect-37.c index 1a5a1003cf8..e54e0c5166c 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-37.c +++ b/gcc/testsuite/gcc.dg/vect/vect-37.c @@ -3,20 +3,19 @@ #include <stdarg.h> #include "tree-vect.h" -typedef char achar __attribute__ ((__aligned__(16))); - #define N 16 -achar x[N]; +char x[N] __attribute__ ((__aligned__(16))); -int main1 (achar *y) +int main1 (char *y) { struct { - achar *p; - achar *q; + char *p; + char *q; } s; - achar cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + char cb[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; int i; + /* Not vectorized - can't antialias the pointer s.p from the array cb. */ s.p = y; for (i = 0; i < N; i++) { @@ -30,6 +29,7 @@ int main1 (achar *y) abort (); } + /* Not vectorized - can't antialias the pointer s.p from the pointer s.q. */ s.q = cb; for (i = 0; i < N; i++) { @@ -53,8 +53,9 @@ int main (void) return main1 (x); } - -/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */ +/* Currently the loops fail to vectorize due to aliasing problems. + If/when the aliasing problems are resolved, unalignment may + prevent vectorization on some targets. */ /* { dg-final { scan-tree-dump-times "vectorized 2 loops" 1 "vect" { xfail *-*-* } } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "can't determine dependence between" 2 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-74.c b/gcc/testsuite/gcc.dg/vect/vect-74.c index d4593cbb891..5dbd3120d69 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-74.c +++ b/gcc/testsuite/gcc.dg/vect/vect-74.c @@ -5,8 +5,6 @@ #define N 16 -typedef float afloat __attribute__ ((__aligned__(16))); - /* Check handling of accesses for which the "initial condition" - the expression that represents the first location accessed - is more involved than just an ssa_name. */ @@ -16,10 +14,10 @@ float b[N+4] __attribute__ ((__aligned__(16))) = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, float c[N] __attribute__ ((__aligned__(16))) = {0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 7.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5}; int -main1 (afloat *__restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__ pc) +main1 (float *__restrict__ pa, float * __restrict__ pb, float * __restrict__ pc) { int i; - afloat *q = pb + 4; + float *q = pb + 4; for (i = 0; i < N; i++) { @@ -44,6 +42,7 @@ int main (void) return 0; } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } } } */ +/* { dg-final { scan-tree-dump-times "Alignment of access forced using peeling" 1 "vect" { xfail vect_no_align } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-75.c b/gcc/testsuite/gcc.dg/vect/vect-75.c index d923a83e28d..db543f86489 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-75.c +++ b/gcc/testsuite/gcc.dg/vect/vect-75.c @@ -6,15 +6,13 @@ #define N 8 #define OFF 8 -typedef int aint __attribute__ ((__aligned__(16))); - /* Check handling of accesses for which the "initial condition" - the expression that represents the first location accessed - is more involved than just an ssa_name. */ int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 14, 22, 26, 34}; -int main1 (aint *ib) +int main1 (int *ib) { int i; int ia[N]; @@ -44,6 +42,6 @@ int main (void) } -/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail vect_no_align } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail vect_no_align } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-76.c b/gcc/testsuite/gcc.dg/vect/vect-76.c index b8312780f5b..40213e80acf 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-76.c +++ b/gcc/testsuite/gcc.dg/vect/vect-76.c @@ -6,15 +6,13 @@ #define N 8 #define OFF 4 -typedef int aint __attribute__ ((__aligned__(16))); - /* Check handling of accesses for which the "initial condition" - the expression that represents the first location accessed - is more involved than just an ssa_name. */ int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10}; -int main1 (aint *pib) +int main1 (int *pib) { int i; int ia[N+OFF]; @@ -71,6 +69,7 @@ int main (void) } -/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */ -/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ +/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_align } } } */ +/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_no_align } } } */ +/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 2 "vect" { xfail vect_no_align } } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-77.c b/gcc/testsuite/gcc.dg/vect/vect-77.c index 79c0ccb7af0..e182ecaa3a4 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-77.c +++ b/gcc/testsuite/gcc.dg/vect/vect-77.c @@ -6,15 +6,13 @@ #define N 8 #define OFF 8 -typedef int aint __attribute__ ((__aligned__(16))); - /* Check handling of accesses for which the "initial condition" - the expression that represents the first location accessed - is more involved than just an ssa_name. */ int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 14, 22, 26, 34}; -int main1 (aint *ib, int off) +int main1 (int *ib, int off) { int i; int ia[N]; diff --git a/gcc/testsuite/gcc.dg/vect/vect-78.c b/gcc/testsuite/gcc.dg/vect/vect-78.c index b4fc63b41e1..d1d367da2bd 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-78.c +++ b/gcc/testsuite/gcc.dg/vect/vect-78.c @@ -6,8 +6,6 @@ #define N 8 #define OFF 8 -typedef int aint __attribute__ ((__aligned__(16))); - /* Check handling of accesses for which the "initial condition" - the expression that represents the first location accessed - is more involved than just an ssa_name. */ @@ -15,7 +13,7 @@ typedef int aint __attribute__ ((__aligned__(16))); int ib[N+OFF] __attribute__ ((__aligned__(16))) = {0, 1, 3, 5, 7, 11, 13, 17, 0, 2, 6, 10, 14, 22, 26, 34}; int off = 8; -int main1 (aint *ib) +int main1 (int *ib) { int i; int ia[N]; diff --git a/gcc/testsuite/gcc.dg/vect/vect-79.c b/gcc/testsuite/gcc.dg/vect/vect-79.c index ffe101d5b3a..8e98e4d0ed9 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-79.c +++ b/gcc/testsuite/gcc.dg/vect/vect-79.c @@ -5,18 +5,18 @@ #define N 16 -typedef float afloat __attribute__ ((__aligned__(16))); +float fa[N] __attribute__ ((__aligned__(16))); +float fb[N+4] __attribute__ ((__aligned__(16))) = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 7.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0}; +float fc[N] __attribute__ ((__aligned__(16))) = {0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 7.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5}; -afloat a[N]; -afloat b[N+4] = {0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 7.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0}; -afloat c[N] = {0.5, 1.5, 2.5, 3.5, 4.5, 5.5, 7.5, 9.5, 10.5, 11.5, 12.5, 13.5, 14.5, 15.5}; +/* Like vect-80.c but the pointers are not annotated as restricted, + and therefore can't be antialiased. */ -/* Not vectorizable. Alias. */ int -main1 (afloat *pa, afloat *pb, afloat *pc) +main1 (float *pa, float *pb, float *pc) { int i; - afloat *q = pb + 4; + float *q = pb + 4; for (i = 0; i < N; i++) { @@ -37,10 +37,14 @@ int main (void) { check_vect (); - main1 (a, b, c); + main1 (fa, fb, fc); return 0; } +/* Currently the loops fail to vectorize due to aliasing problems. + If/when the aliasing problems are resolved, unalignment may + prevent vectorization on some targets. */ /* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { xfail *-*-* } } } */ +/* { dg-final { scan-tree-dump-times "can't determine dependence between" 1 "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */ diff --git a/gcc/testsuite/gcc.dg/vect/vect-97.c b/gcc/testsuite/gcc.dg/vect/vect-97.c index 5bb7a485f16..bf92dac7a1a 100644 --- a/gcc/testsuite/gcc.dg/vect/vect-97.c +++ b/gcc/testsuite/gcc.dg/vect/vect-97.c @@ -3,20 +3,21 @@ #include <stdarg.h> #include "tree-vect.h" -typedef char achar __attribute__ ((__aligned__(16))); - #define N 16 int main1 () { struct { - achar *p; - achar *q; + char *p; + char *q; } s; int i; - achar x[N]; - achar cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + char x[N] __attribute__ ((__aligned__(16))); + char cb[N] __attribute__ ((__aligned__(16))) = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45}; + /* Check that datarefs analysis can determine that the access via pointer + s.p is based off array x, which enables us to antialias this access from + the access to array cb. */ s.p = x; for (i = 0; i < N; i++) { @@ -30,6 +31,9 @@ int main1 () abort (); } + /* Check that datarefs analysis can determine that the access via pointer + s.p is based off array x, and that the access via pointer s.q is based off + array cb, which enables us to antialias these two accesses. */ s.q = cb; for (i = 0; i < N; i++) { |