Commit a417b482 by Dorit Nuzman Committed by Dorit Nuzman

pr16105.c: Replace "aligned types" with regular types.

        * 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.

From-SVN: r104445
parent da8f5fd9
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> 2005-09-19 Steven Bosscher <stevenb@suse.de>
* gcc.dg/pr23943.c: New test. * gcc.dg/pr23943.c: New test.
...@@ -2,12 +2,11 @@ ...@@ -2,12 +2,11 @@
/* { dg-require-effective-target vect_float } */ /* { dg-require-effective-target vect_float } */
#define VECTOR_SIZE 512 #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, void square(const float * __restrict__ a,
afloat * __restrict__ out) float * __restrict__ out)
{ {
unsigned int i; unsigned int i;
for (i = 0; i < VECTOR_SIZE; i++) { for (i = 0; i < VECTOR_SIZE; i++) {
...@@ -18,5 +17,5 @@ void square(const afloat * __restrict__ a, ...@@ -18,5 +17,5 @@ void square(const afloat * __restrict__ a,
check(out); 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" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */
...@@ -3,15 +3,12 @@ ...@@ -3,15 +3,12 @@
#include <stdarg.h> #include <stdarg.h>
#include "tree-vect.h" #include "tree-vect.h"
typedef short ashort __attribute__ ((__aligned__(16))); short Kernshort[24] __attribute__ ((__aligned__(16)));
ashort Kernshort[24]; static void VecBug(short Kernel[8][24]) __attribute__((noinline));
static void VecBug(ashort Kernel[8][24]) __attribute__((noinline)); static void VecBug2(short 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]);
/* Not vectorizable: Kernel may alias Kernshort - a global array. */ /* 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; int k,i;
for (k = 0; k<8; k++) for (k = 0; k<8; k++)
...@@ -20,10 +17,10 @@ static void VecBug(ashort Kernel[8][24]) ...@@ -20,10 +17,10 @@ static void VecBug(ashort Kernel[8][24])
} }
/* Vectorizable: Kernshort2 is local. */ /* Vectorizable: Kernshort2 is local. */
static void VecBug2(ashort Kernel[8][24]) static void VecBug2(short Kernel[8][24])
{ {
int k,i; int k,i;
ashort Kernshort2[24]; short Kernshort2[24] __attribute__ ((__aligned__(16)));
for (k = 0; k<8; k++) for (k = 0; k<8; k++)
for (i = 0; i<24; i++) for (i = 0; i<24; i++)
Kernshort2[i] = Kernel[k][i]; Kernshort2[i] = Kernel[k][i];
...@@ -38,7 +35,7 @@ int main (int argc, char **argv) ...@@ -38,7 +35,7 @@ int main (int argc, char **argv)
{ {
check_vect (); check_vect ();
ashort Kernel[8][24]; short Kernel[8][24] __attribute__ ((__aligned__(16)));
int k,i; int k,i;
for (k = 0; k<8; k++) for (k = 0; k<8; k++)
...@@ -52,5 +49,5 @@ int main (int argc, char **argv) ...@@ -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" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */
...@@ -3,20 +3,19 @@ ...@@ -3,20 +3,19 @@
#include <stdarg.h> #include <stdarg.h>
#include "tree-vect.h" #include "tree-vect.h"
typedef char achar __attribute__ ((__aligned__(16)));
#define N 16 #define N 16
achar x[N]; char x[N] __attribute__ ((__aligned__(16)));
int main1 (achar *y) int main1 (char *y)
{ {
struct { struct {
achar *p; char *p;
achar *q; char *q;
} s; } 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; int i;
/* Not vectorized - can't antialias the pointer s.p from the array cb. */
s.p = y; s.p = y;
for (i = 0; i < N; i++) for (i = 0; i < N; i++)
{ {
...@@ -30,6 +29,7 @@ int main1 (achar *y) ...@@ -30,6 +29,7 @@ int main1 (achar *y)
abort (); abort ();
} }
/* Not vectorized - can't antialias the pointer s.p from the pointer s.q. */
s.q = cb; s.q = cb;
for (i = 0; i < N; i++) for (i = 0; i < N; i++)
{ {
...@@ -53,8 +53,9 @@ int main (void) ...@@ -53,8 +53,9 @@ int main (void)
return main1 (x); return main1 (x);
} }
/* Currently the loops fail to vectorize due to aliasing problems.
/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 1 "vect" } } */ 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 "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" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */
...@@ -5,8 +5,6 @@ ...@@ -5,8 +5,6 @@
#define N 16 #define N 16
typedef float afloat __attribute__ ((__aligned__(16)));
/* Check handling of accesses for which the "initial condition" - /* Check handling of accesses for which the "initial condition" -
the expression that represents the first location accessed - is the expression that represents the first location accessed - is
more involved than just an ssa_name. */ 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, ...@@ -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}; 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 int
main1 (afloat *__restrict__ pa, afloat * __restrict__ pb, afloat * __restrict__ pc) main1 (float *__restrict__ pa, float * __restrict__ pb, float * __restrict__ pc)
{ {
int i; int i;
afloat *q = pb + 4; float *q = pb + 4;
for (i = 0; i < N; i++) for (i = 0; i < N; i++)
{ {
...@@ -44,6 +42,7 @@ int main (void) ...@@ -44,6 +42,7 @@ int main (void)
return 0; return 0;
} }
/* { 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 { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ /* { 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" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */
...@@ -6,15 +6,13 @@ ...@@ -6,15 +6,13 @@
#define N 8 #define N 8
#define OFF 8 #define OFF 8
typedef int aint __attribute__ ((__aligned__(16)));
/* Check handling of accesses for which the "initial condition" - /* Check handling of accesses for which the "initial condition" -
the expression that represents the first location accessed - is the expression that represents the first location accessed - is
more involved than just an ssa_name. */ 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 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 i;
int ia[N]; int ia[N];
...@@ -44,6 +42,6 @@ int main (void) ...@@ -44,6 +42,6 @@ int main (void)
} }
/* { 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 { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ /* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 1 "vect" { xfail vect_no_align } } } */
/* { dg-final { cleanup-tree-dump "vect" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */
...@@ -6,15 +6,13 @@ ...@@ -6,15 +6,13 @@
#define N 8 #define N 8
#define OFF 4 #define OFF 4
typedef int aint __attribute__ ((__aligned__(16)));
/* Check handling of accesses for which the "initial condition" - /* Check handling of accesses for which the "initial condition" -
the expression that represents the first location accessed - is the expression that represents the first location accessed - is
more involved than just an ssa_name. */ 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 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 i;
int ia[N+OFF]; int ia[N+OFF];
...@@ -71,6 +69,7 @@ int main (void) ...@@ -71,6 +69,7 @@ int main (void)
} }
/* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" } } */ /* { dg-final { scan-tree-dump-times "vectorized 3 loops" 1 "vect" { xfail vect_no_align } } } */
/* { dg-final { scan-tree-dump-times "Vectorizing an unaligned access" 0 "vect" } } */ /* { 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" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */
...@@ -6,15 +6,13 @@ ...@@ -6,15 +6,13 @@
#define N 8 #define N 8
#define OFF 8 #define OFF 8
typedef int aint __attribute__ ((__aligned__(16)));
/* Check handling of accesses for which the "initial condition" - /* Check handling of accesses for which the "initial condition" -
the expression that represents the first location accessed - is the expression that represents the first location accessed - is
more involved than just an ssa_name. */ 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 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 i;
int ia[N]; int ia[N];
......
...@@ -6,8 +6,6 @@ ...@@ -6,8 +6,6 @@
#define N 8 #define N 8
#define OFF 8 #define OFF 8
typedef int aint __attribute__ ((__aligned__(16)));
/* Check handling of accesses for which the "initial condition" - /* Check handling of accesses for which the "initial condition" -
the expression that represents the first location accessed - is the expression that represents the first location accessed - is
more involved than just an ssa_name. */ more involved than just an ssa_name. */
...@@ -15,7 +13,7 @@ typedef int aint __attribute__ ((__aligned__(16))); ...@@ -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 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 off = 8;
int main1 (aint *ib) int main1 (int *ib)
{ {
int i; int i;
int ia[N]; int ia[N];
......
...@@ -5,18 +5,18 @@ ...@@ -5,18 +5,18 @@
#define N 16 #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]; /* Like vect-80.c but the pointers are not annotated as restricted,
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}; and therefore can't be antialiased. */
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};
/* Not vectorizable. Alias. */
int int
main1 (afloat *pa, afloat *pb, afloat *pc) main1 (float *pa, float *pb, float *pc)
{ {
int i; int i;
afloat *q = pb + 4; float *q = pb + 4;
for (i = 0; i < N; i++) for (i = 0; i < N; i++)
{ {
...@@ -37,10 +37,14 @@ int main (void) ...@@ -37,10 +37,14 @@ int main (void)
{ {
check_vect (); check_vect ();
main1 (a, b, c); main1 (fa, fb, fc);
return 0; 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 "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" } } */ /* { dg-final { cleanup-tree-dump "vect" } } */
...@@ -3,20 +3,21 @@ ...@@ -3,20 +3,21 @@
#include <stdarg.h> #include <stdarg.h>
#include "tree-vect.h" #include "tree-vect.h"
typedef char achar __attribute__ ((__aligned__(16)));
#define N 16 #define N 16
int main1 () int main1 ()
{ {
struct { struct {
achar *p; char *p;
achar *q; char *q;
} s; } s;
int i; int i;
achar x[N]; char x[N] __attribute__ ((__aligned__(16)));
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};
/* 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; s.p = x;
for (i = 0; i < N; i++) for (i = 0; i < N; i++)
{ {
...@@ -30,6 +31,9 @@ int main1 () ...@@ -30,6 +31,9 @@ int main1 ()
abort (); 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; s.q = cb;
for (i = 0; i < N; i++) for (i = 0; i < N; i++)
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment