+2017-11-09 Richard Sandiford <richard.sandiford@linaro.org>
+ Alan Hayward <alan.hayward@arm.com>
+ David Sherwood <david.sherwood@arm.com>
+
+ * gcc.dg/vect/bb-slp-cond-1.c (main): Add an asm volatile
+ to the set-up loop.
+ * gcc.dg/vect/slp-perm-7.c (main): Prevent vectorisation with
+ asm volatile ("" ::: "memory") instead of a conditional abort.
+ Update the expected vector loop count accordingly.
+ * gcc.dg/vect/slp-perm-9.c (main): Likewise.
+ * gcc.dg/vect/bb-slp-1.c (main1): Prevent vectorisation with
+ asm volatile ("" ::: "memory") instead of a conditional abort.
+ * gcc.dg/vect/slp-23.c (main): Likewise,
+ * gcc.dg/vect/slp-35.c (main): Likewise,
+ * gcc.dg/vect/slp-37.c (main): Likewise,
+ * gcc.dg/vect/slp-perm-4.c (main): Likewise.
+ * gcc.dg/vect/bb-slp-24.c (foo): Likewise. Remove dummy argument.
+ (main): Update call accordingly.
+ * gcc.dg/vect/bb-slp-25.c (foo, main): As for bb-slp-24.c.
+ * gcc.dg/vect/bb-slp-26.c (foo, main): Likewise.
+ * gcc.dg/vect/bb-slp-29.c (foo, main): Likewise.
+ * gcc.dg/vect/no-vfa-vect-102.c (foo): Delete.
+ (main): Don't initialize it.
+ (main1): Prevent vectorisation with asm volatile ("" ::: "memory")
+ instead of a conditional abort.
+ * gcc.dg/vect/no-vfa-vect-102a.c (foo, main1, main): As for
+ no-vfa-vect-102.c
+ * gcc.dg/vect/vect-103.c (foo, main1, main): Likewise.
+ * gcc.dg/vect/vect-104.c (foo, main1, main): Likewise.
+ * gcc.dg/vect/pr42709.c (main1): Remove dummy argument.
+ Prevent vectorisation with asm volatile ("" ::: "memory")
+ instead of a conditional abort.
+ * gcc.dg/vect/slp-13-big-array.c (y): Delete.
+ (main1): Prevent vectorisation with asm volatile ("" ::: "memory")
+ instead of a conditional abort.
+ * gcc.dg/vect/slp-3-big-array.c (y, main1): As for slp-13-big-array.c.
+ * gcc.dg/vect/slp-34-big-array.c (y, main1): Likewise.
+ * gcc.dg/vect/slp-4-big-array.c (y, main1): Likewise.
+ * gcc.dg/vect/slp-multitypes-11-big-array.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-105.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-105-big-array.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-112-big-array.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-15-big-array.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-2-big-array.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-34-big-array.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-6-big-array.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-73-big-array.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-74-big-array.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-75-big-array.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-76-big-array.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-80-big-array.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-97-big-array.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-all-big-array.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-reduc-1char-big-array.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-reduc-2char-big-array.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-strided-a-mult.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-strided-a-u16-i2.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-strided-a-u16-i4.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-strided-a-u16-mult.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-strided-a-u8-i2-gap.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-strided-a-u8-i8-gap2-big-array.c (y, main1):
+ Likewise.
+ * gcc.dg/vect/vect-strided-a-u8-i8-gap2.c (y, main1): Likewise.
+ * gcc.dg/vect/vect-strided-a-u8-i8-gap7-big-array.c (y, main1):
+ Likewise.
+ * gcc.dg/vect/vect-strided-a-u8-i8-gap7.c (y, main1): Likewise.
+ * gcc.dg/vect/slp-24.c (y): Delete.
+ (main): Prevent vectorisation with asm volatile ("" ::: "memory")
+ instead of a conditional abort.
+ * gcc.dg/vect/slp-24-big-array.c (y, main): As for slp-24.c.
+ * gcc.dg/vect/vect-98-big-array.c (y, main): Likewise.
+ * gcc.dg/vect/vect-bswap16.c (y, main): Likewise.
+ * gcc.dg/vect/vect-bswap32.c (y, main): Likewise.
+ * gcc.dg/vect/vect-bswap64.c (y, main): Likewise.
+ * gcc.dg/vect/vect-strided-mult-char-ls.c (y, main): Likewise.
+ * gcc.dg/vect/vect-strided-mult.c (y, main): Likewise.
+ * gcc.dg/vect/vect-strided-same-dr.c (y, main): Likewise.
+ * gcc.dg/vect/vect-strided-u16-i2.c (y, main): Likewise.
+ * gcc.dg/vect/vect-strided-u16-i4.c (y, main): Likewise.
+ * gcc.dg/vect/vect-strided-u32-i4.c (y, main): Likewise.
+ * gcc.dg/vect/vect-strided-u32-i8.c (y, main): Likewise.
+ * gcc.dg/vect/vect-strided-u8-i2-gap.c (y, main): Likewise.
+ * gcc.dg/vect/vect-strided-u8-i2.c (y, main): Likewise.
+ * gcc.dg/vect/vect-strided-u8-i8-gap2-big-array.c (y, main): Likewise.
+ * gcc.dg/vect/vect-strided-u8-i8-gap2.c (y, main): Likewise.
+ * gcc.dg/vect/vect-strided-u8-i8-gap4-big-array.c (y, main): Likewise.
+ * gcc.dg/vect/vect-strided-u8-i8-gap4-unknown.c (y, main): Likewise.
+ * gcc.dg/vect/vect-strided-u8-i8-gap4.c (y, main): Likewise.
+ * gcc.dg/vect/vect-strided-u8-i8-gap7-big-array.c (y, main): Likewise.
+ * gcc.dg/vect/vect-strided-u8-i8-gap7.c (y, main): Likewise.
+ * gcc.dg/vect/vect-strided-u8-i8.c (y, main): Likewise.
+ * gcc.dg/vect/vect-10-big-array.c (y): Delete.
+ (foo): Prevent vectorisation with asm volatile ("" ::: "memory")
+ instead of a conditional abort.
+ * gcc.dg/vect/vect-double-reduc-6-big-array.c (y, foo): As for
+ vect-10-big-array.c.
+ * gcc.dg/vect/vect-reduc-pattern-1b-big-array.c (y, foo): Likewise.
+ * gcc.dg/vect/vect-reduc-pattern-1c-big-array.c (y, foo): Likewise.
+ * gcc.dg/vect/vect-reduc-pattern-2b-big-array.c (y, foo): Likewise.
+ * gcc.dg/vect/vect-117.c (foo): Delete.
+ (main): Don't initalize it.
+
2017-11-09 Jan Hubicka <hubicka@ucw.cz>
* gcc.c-torture/compile/pr82879.c: New testcase.
*pout++ = *pin++;
*pout++ = *pin++;
*pout++ = *pin++;
- /* Avoid loop vectorization. */
- if (dummy == 32)
- abort ();
+ asm volatile ("" ::: "memory");
}
/* check results: */
short src[N], dst[N];
void foo (short * __restrict__ dst, short * __restrict__ src, int h,
- int stride, int dummy)
+ int stride)
{
int i;
h /= 8;
dst[7] += A*src[7];
dst += stride;
src += stride;
- if (dummy == 32)
- abort ();
+ asm volatile ("" ::: "memory");
}
}
src[i] = i;
}
- foo (dst, src, N, 8, 0);
+ foo (dst, src, N, 8);
for (i = 0; i < N; i++)
{
short src[N], dst[N];
-void foo (short * __restrict__ dst, short * __restrict__ src, int h, int stride, int dummy)
+void foo (short * __restrict__ dst, short * __restrict__ src, int h,
+ int stride)
{
int i;
h /= 16;
dst[7] += A*src[7] + src[7+stride];
dst += 8;
src += 8;
- if (dummy == 32)
- abort ();
+ asm volatile ("" ::: "memory");
}
}
src[i] = i;
}
- foo (dst, src, N, 8, 0);
+ foo (dst, src, N, 8);
for (i = 0; i < N/2; i++)
{
char src[N], dst[N];
void __attribute__((noinline,noclone))
-foo (char * __restrict__ dst, char * __restrict__ src, int h,
- int stride, int dummy)
+foo (char * __restrict__ dst, char * __restrict__ src, int h, int stride)
{
int i;
h /= 16;
dst[7] += A*src[7] + src[7+stride];
dst += 8;
src += 8;
- if (dummy == 32)
- abort ();
+ asm volatile ("" ::: "memory");
}
}
src[i] = i/8;
}
- foo (dst, src, N, 8, 0);
+ foo (dst, src, N, 8);
for (i = 0; i < N/2; i++)
{
short src[N], dst[N];
-void foo (short * __restrict__ dst, short * __restrict__ src, int h, int stride, int dummy)
+void foo (short * __restrict__ dst, short * __restrict__ src, int h,
+ int stride)
{
int i;
h /= 16;
dst[7] = A*src[7] + B*src[8];
dst += stride;
src += stride;
- if (dummy == 32)
- abort ();
+ asm volatile ("" ::: "memory");
}
}
src[i] = i;
}
- foo (dst, src, N, 8, 0);
+ foo (dst, src, N, 8);
for (i = 0; i < N/2; i++)
{
check_vect ();
for (i = 0; i < N; i++)
- a[i] = i;
+ {
+ a[i] = i;
+ asm volatile ("" ::: "memory");
+ }
foo (a, 4);
static int a[N] = {1,2,3,4,5,6,7,8,9};
static int b[N] = {2,3,4,5,6,7,8,9,9};
-volatile int foo;
__attribute__ ((noinline))
int main1 (int x, int y) {
for (i = 0; i < N; i++)
{
- p->a[i] = a[i];
- if (foo == 135)
- abort (); /* to avoid vectorization */
+ p->a[i] = a[i];
+ asm volatile ("" ::: "memory");
}
/* Not vectorizable: distance 1. */
{
check_vect ();
- foo = 0;
return main1 (0, N);
}
static int a[N] = {1,2,3,4,5,6,7,8,9};
static int b[N] = {2,3,4,5,6,7,8,9,9};
-volatile int foo;
__attribute__ ((noinline))
int main1 (int x, int y) {
for (i = 0; i < N; i++)
{
- p->a[i] = a[i];
- if (foo == 135)
- abort (); /* to avoid vectorization */
+ p->a[i] = a[i];
+ asm volatile ("" ::: "memory");
}
/* Not vectorizable: distance 1. */
{
check_vect ();
- foo = 0;
return main1 (0, N);
}
int *res[N];
int
-main1 (int *a, int *b, int *c, int *d, int dummy)
+main1 (int *a, int *b, int *c, int *d)
{
int i;
res[i+1] = b + 16;
res[i+2] = c + 16;
res[i+3] = d + 16;
- if (dummy == 32)
- abort ();
+ asm volatile ("" ::: "memory");
}
}
#include "tree-vect.h"
#define N 64
-volatile int y = 0;
int
main1 ()
for (i = 0; i < N*8; i++)
{
in[i] = in2[i] = i;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
/* Induction is SLPable. */
arr[i].f = i * 5;
arr[i].g = i - 3;
arr[i].h = 56;
- if (arr[i].a == 178)
- abort();
+ asm volatile ("" ::: "memory");
}
main1 (arr);
unsigned char ub[N*2];
unsigned char uc[N];
-volatile int y = 0;
unsigned char check_diff = 2;
void
ub[i] = (i%5 == 0)?i*3:i;
uc[i] = i;
check_diff += (unsigned char) (ub[i] - uc[i]);
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
for (; i < 2*N; i++) {
ub[i] = 0;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
arr[i].b = i * 2 + 10;
arr[i].c = 17;
arr[i].d = i+34;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
check_vect ();
unsigned char ub[N*2] = {1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45,1,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
unsigned char uc[N] = {1,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15};
-volatile int y = 0;
-
void
main1 (unsigned char x, unsigned char max_result, unsigned char min_result, s *arr)
{
arr[i].b = i * 2 + 10;
arr[i].c = 17;
arr[i].d = i+34;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
check_vect ();
#define N 96
unsigned short in[N*8];
-volatile int y = 0;
int
main1 ()
for (i = 0; i < N*8; i++)
{
in[i] = i&63;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
unsigned short in[N*8];
unsigned short in2[N*8];
-volatile int y = 0;
int
main1 ()
for (i = 0; i < N*8; i++)
{
in[i] = in2[i] = i;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
/* SLP with unrolling by 8. */
arr[i].c = 17;
arr[i].d = i+34;
arr[i].e = i * 3 + 5;
- if (arr[i].a == 178)
- abort();
+ asm volatile ("" ::: "memory");
}
main1 (arr);
arr1[i].a = i;
arr1[i].b = i * 2;
arr1[i].c = (void *)arr1;
-
- if (arr1[i].a == 178)
- abort();
+ asm volatile ("" ::: "memory");
}
#include "tree-vect.h"
#define N 128
-volatile int y = 0;
int
main1 ()
for (i = 0; i < N*8; i++)
{
in[i] = i;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
};
char in[N*3];
-volatile int y = 0;
__attribute__ ((noinline)) int
main1 ()
for (i = 0; i < N; i++)
{
in[i] = i&127;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
for (i = 0; i < N; i++)
{
input[i] = i%256;
- if (input[i] > 200)
- abort();
output[i] = 0;
- __asm__ volatile ("");
+ asm volatile ("" ::: "memory");
}
foo (input, output);
input2[i] = i%256;
output[i] = 0;
output2[i] = 0;
- if (input[i] > 200)
- abort ();
+ asm volatile ("" ::: "memory");
}
foo (input, output, input2, output2);
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target vect_perm } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target vect_perm } } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { vect_perm && {! vect_load_lanes } } } } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target vect_load_lanes } } } */
/* { dg-final { scan-tree-dump "note: Built SLP cancelled: can use load/store-lanes" "vect" { target { vect_perm && vect_load_lanes } } } } */
{
input[i] = i;
output[i] = 0;
- if (input[i] > 256)
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N / 3; i++)
return 0;
}
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { {! vect_perm } || {! vect_sizes_16B_8B } } } } } */
-/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" { target { { vect_perm } && { vect_sizes_16B_8B } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 0 loops" 2 "vect" { target { {! vect_perm } || {! vect_sizes_16B_8B } } } } } */
+/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 1 "vect" { target { { vect_perm } && { vect_sizes_16B_8B } } } } } */
/* { dg-final { scan-tree-dump-times "permutation requires at least three vectors" 1 "vect" { target vect_perm_short } } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 0 "vect" { target { {! vect_perm } || {! vect_sizes_32B_16B } } } } } */
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 1 "vect" { target { { vect_perm } && { vect_sizes_32B_16B } } } } } */
short a[N];
short d[N];
-volatile int y = 0;
-
int foo ()
{
int i;
{
b[i] = i*3;
c[i] = i;
-
- /* Avoid vectorization. */
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
/* Strided access pattern. */
static int a[N] = {1,2,3,4,5,6,7,8,9};
static int b[N] = {17,24,7,0,2,3,4,31,82};
static int c[N] = {9,17,24,7,0,2,3,4,31};
-volatile int foo;
__attribute__ ((noinline))
int main1 (int x, int y) {
for (i = 0; i < N; i++)
{
- p->a[i] = a[i];
- p->b[i] = b[i];
- if (foo == 135)
- abort (); /* to avoid vectorization */
+ p->a[i] = a[i];
+ p->b[i] = b[i];
+ asm volatile ("" ::: "memory");
}
/* Vectorizable: distance > VF. */
{
check_vect ();
- foo = 0;
return main1 (0, N);
}
static int a[N][N] = {{1,2,3},{4,5,6},{7,8,9}};
static int b[N][N] = {{17,24,7},{0,2,3},{4,31,82}};
static int c[N][N] = {{1,2,3},{4,5,5},{5,5,5}};
-volatile int foo;
__attribute__ ((noinline))
int main1 (int x) {
{
p->a[i][j] = a[i][j];
p->b[i][j] = b[i][j];
- if (foo == 135)
- abort (); /* to avoid vectorization */
+ asm volatile ("" ::: "memory");
}
}
{
check_vect ();
- foo = 0;
return main1 (N);
}
static int b[N][N];
static int c[N][N];
-volatile int y;
-
__attribute__ ((noinline))
int main1 (int x) {
int i,j, off;
{
a[i][j] = (i*7 + j*17)%53;
b[i][j] = (i*11+ j*13)%41;
- if (y)
- abort (); /* to avoid vectorization. */
+ asm volatile ("" ::: "memory");
}
}
for (i = 0; i < N; i++)
for (j = 0; j < N; j++)
{
c[i][j] = a[i][j];
- if (y)
- abort (); /* to avoid vectorization. */
+ asm volatile ("" ::: "memory");
}
}
for (i = 1; i < N; i++)
*(&c[0][0]+x+i+j) = *(&b[0][0] + off - N*N);
else
*(&c[0][0]+x+i+j) = *(&a[0][0] + off);
- if (y)
- abort (); /* to avoid vectorization. */
+ asm volatile ("" ::: "memory");
}
}
{
p->a[i][j] = a[i][j];
p->b[i][j] = b[i][j];
- /* Because Y is volatile, the compiler cannot move this check out
- of the loop. */
- if (y)
- abort (); /* to avoid vectorization. */
+ asm volatile ("" ::: "memory");
}
}
static int b[N][N] = {{17,28,15,23},{0,2,3,24},{4,31,82,25},{29,31,432,256}};
static int c[N][N] = {{1,2,3,11},{4,9,13,34},{45,67,83,13},{34,45,67,83}};
-volatile int y;
-
__attribute__ ((noinline))
int main1 (int x) {
int i,j;
{
p->a[i][j] = a[i][j];
p->b[i][j] = b[i][j];
- /* Because Y is volatile, the compiler cannot move this check out
- of the loop. */
- if (y)
- abort (); /* to avoid vectorization */
+ asm volatile ("" ::: "memory");
}
}
char cb[N];
char cc[N];
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 (void)
{
cb[i] = i + 2;
cc[i] = i + 1;
check_diff += (cb[i] - cc[i]);
- /* Avoid vectorization. */
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
/* Cross-iteration cycle. */
{34,38,42,46,50},
{55,60,65,70,75}};
-volatile int foo;
-
__attribute__ ((noinline))
int main1 (int A[N][N], int n)
{
check_vect ();
- foo = 0;
main1 (a, N);
/* check results: */
#define N 128
-volatile int y = 0;
-
__attribute__ ((noinline))
int main1 ()
{
for (i = 0; i <N; i++)
{
b[i] = i*3;
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
/* Not vectorizable yet (reverse access and forward access). */
char cb[N];
char ca[N];
-volatile int y = 0;
-
__attribute__ ((noinline))
int main1 ()
{
for (i = 0; i < N; i++)
{
cb[i] = i*3;
- /* To avoid vectorization. */
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
} s;
char cb[N];
-volatile int y = 0;
-
__attribute__ ((noinline))
int main1 ()
{
for (i = 0; i < N; i++)
{
cb[i] = i*3;
- /* To avoid vectorization. */
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
{
float b[N];
float c[N];
-volatile int y = 0;
-
__attribute__ ((noinline))
int main1 ()
{
c[i] = i;
results1[i] = 0;
results2[i] = 0;
- /* Avoid vectorization. */
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i=0; i<N/2; i++)
{
results1[i] = b[i+N/2] * c[i+N/2] - b[i] * c[i];
results2[i+N/2] = b[i] * c[i+N/2] + b[i+N/2] * c[i];
- /* Avoid vectorization. */
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N/2; i++)
#define ia (ic+N)
-volatile int y = 0;
-
__attribute__ ((noinline))
int main1 ()
{
for (i = 0; i < N; i++)
{
ib[i] = i*3;
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
float b[N+4] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {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 c[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {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};
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 (float *__restrict__ pa, float * __restrict__ pb, float * __restrict__ pc)
{
{
b[i] = i;
c[i] = 0.5 + i;
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
for (; i < N+4; i++)
{
b[i] = i;
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
int ib[N+OFF] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0, 1, 3, 5, 7, 11, 13, 17};
-volatile int y = 0;
-
__attribute__ ((noinline))
int main1 (int *ib)
{
for (i = OFF; i < N+OFF; i++)
{
ib[i] = ib[i%OFF]*(i/OFF);
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
{
int ib[N+OFF] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__))) = {0, 1, 3, 5, 7, 11, 13, 17};
int ic[N+OFF] = {0, 1, 3, 5, 7, 11, 13, 17};
-volatile int y = 0;
-
__attribute__ ((noinline))
int main1 (int *pib)
{
{
ib[i] = ib[i%8]*(i/8);
ic[i] = ic[i%8]*(i/8);
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = OFF; i < N; i++)
the expression that represents the first location accessed - is
more involved than just an ssa_name. */
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 (float * __restrict__ pa, float * __restrict__ pb, float *__restrict__ pc)
{
{
fb[i] = i;
fc[i] = 0.5+i;
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
for (; i < N+4; i++)
{
fb[i] = i;
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
char x[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
char cb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
-volatile int y = 0;
-
__attribute__ ((noinline))
int main1 ()
{
for (i = 0; i < N; i++)
{
cb[i] = i*3;
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
/* Check that datarefs analysis can determine that the access via pointer
a[8]*b[8] + a[9]*b[9] + a[10]*b[10] + a[11]*b[11] + \
a[12]*b[12] + a[13]*b[13] + a[14]*b[14] + a[15]*b[15])
-volatile int y = 0;
-
__attribute__ ((noinline))
int main1 (int ia[][N])
{
for (j = 0; j < N; j++)
{
ia[i][j] = i + j + 1;
- /* Avoid vectorization. */
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
check_vect ();
char ca[N];
short sa[N];
-volatile int y = 0;
-
/* All of the loops below are currently vectorizable, except
initialization ones. */
fmul_results[i] = b[i] * c[i];
fresults1[i] = 0;
fresults2[i] = 0;
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
/* Test 1: copy chars. */
{
fresults1[i] = a[i];
fresults2[i] = e[i];
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N/2; i++)
{
fresults1[i] = b[i+N/2] * c[i+N/2] - b[i] * c[i];
fresults2[i+N/2] = b[i] * c[i+N/2] + b[i+N/2] * c[i];
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
/* Test 4: access with offset. */
for (i = 0; i < N/2; i++)
#define N 128
-volatile int y = 0;
-
static inline void
vfoo16 (unsigned short int* a)
{
{
arr[i] = i;
expect[i] = __builtin_bswap16 (i);
- if (y) /* Avoid vectorisation. */
- abort ();
+ asm volatile ("" ::: "memory");
}
vfoo16 (arr);
#define N 128
-volatile int y = 0;
-
static inline void
vfoo32 (unsigned int* a)
{
{
arr[i] = i;
expect[i] = __builtin_bswap32 (i);
- if (y) /* Avoid vectorisation. */
- abort ();
+ asm volatile ("" ::: "memory");
}
vfoo32 (arr);
#define N 128
-volatile int y = 0;
-
static inline void
vfoo64 (unsigned long long* a)
{
{
arr[i] = i;
expect[i] = __builtin_bswap64 (i);
- if (y) /* Avoid vectorisation. */
- abort ();
+ asm volatile ("" ::: "memory");
}
vfoo64 (arr);
int out[K];
int check_result[K];
-volatile int y = 0;
-
__attribute__ ((noinline)) void
foo ()
{
for (i = 0; i < K; i++)
{
sum *= in[i+k][j];
- /* Avoid vectorization. */
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
check_result[k] = sum;
}
unsigned char uc[N];
unsigned char diff;
-volatile int y = 0;
-
__attribute__ ((noinline)) void
main1 (unsigned char x, unsigned char max_result, unsigned char min_result)
{
if (uc[i] < min_result)
min_result = uc[i];
- /* Avoid vectorization. */
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++) {
udiff += (unsigned char) (ub[i] - uc[i]);
#include "tree-vect.h"
#define N 256
-volatile int y = 0;
__attribute__ ((noinline))
void main1 (signed char x, signed char max_result, signed char min_result)
max_result = c[i];
if (c[i] < min_result)
min_result = c[i];
- /* Avoid vectorization. */
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++) {
unsigned char udata_ch[N];
#define SUM N*(N-1)
-volatile int y = 0;
-
__attribute__ ((noinline)) int
foo ()
{
for (i = 0; i < N; i++)
{
udata_ch[i] = i*2;
- /* Avoid vectorization. */
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
/* widenning sum: sum chars into int. */
unsigned char udata_ch[N];
#define SUM N*(N-1)
-volatile int y = 0;
-
__attribute__ ((noinline)) int
foo ()
{
for (i = 0; i < N; i++)
{
udata_ch[i] = i*2;
- /* Avoid vectorization. */
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
/* widenning sum: sum chars into short. */
#define N 128
signed char data_ch[N];
-volatile int y = 0;
-
__attribute__ ((noinline)) int
foo ()
{
{
data_ch[i] = i*2;
check_intsum += data_ch[i];
- /* Avoid vectorization. */
- if (y)
- abort ();
+ asm volatile ("" ::: "memory");
}
/* widenning sum: sum chars into int. */
unsigned int b;
} ii;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 ()
{
arr[i].b = i * 2;
iarr[i].a = i;
iarr[i].b = i * 3;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
unsigned short b;
} s;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 ()
{
{
arr[i].a = i;
arr[i].b = i * 2;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
unsigned short d;
} s;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 ()
{
arr[i].b = i * 2;
arr[i].c = 17;
arr[i].d = i+34;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
unsigned short b;
} s;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 ()
{
arr[i].a = i;
arr[i].b = i * 2;
iarr[i] = i * 3;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
unsigned char b;
} s;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 ()
{
{
arr[i].a = i;
arr[i].b = i * 2;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
unsigned char h;
} s;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 ()
{
check_res[i].h = arr[i].f;
check_res[i].g = arr[i].f - arr[i].a;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
unsigned char h;
} s;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 ()
{
arr[i].f = i * 2 + 2;
arr[i].g = i - 3;
arr[i].h = 56;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
unsigned char h;
} s;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 ()
{
check_res[i].h = arr[i].d;
check_res[i].g = u + t;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
unsigned char h;
} s;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 ()
{
arr[i].f = i * 5;
arr[i].g = i - 3;
arr[i].h = 67;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
unsigned int b;
} ii;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 (s *arr, ii *iarr)
{
arr[i].b = i * 2;
iarr[i].a = i;
iarr[i].b = i * 3;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
main1 (arr, iarr);
unsigned int b;
} ii;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 (s *arr, ii *iarr)
{
arr[i].b = i * 2;
iarr[i].a = i;
iarr[i].b = i * 3;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
main1 (arr, iarr);
s buffer1[N], buffer2[N];
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 (s * __restrict__ pIn, s* __restrict__ pOut)
{
buffer1[i].b = i + 8;
buffer2[i].a = i * 3;
buffer2[i].b = i * 2;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
check_vect ();
unsigned short b;
} s;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 (s *arr)
{
{
arr[i].a = i;
arr[i].b = i * 2;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
main1 (arr);
unsigned short d;
} s;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 (s *arr)
{
arr[i].b = i * 2;
arr[i].c = 17;
arr[i].d = i+34;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
main1 (arr);
int d;
} s;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 (s *arr)
{
arr[i].b = i * 2;
arr[i].c = 17;
arr[i].d = i+34;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
main1 (arr);
int h;
} s;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 (s *arr)
{
arr[i].f = i * 5;
arr[i].g = i - 3;
arr[i].h = 56;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
main1 (arr);
unsigned char b;
} s;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 (s *arr)
{
{
arr[i].a = i;
arr[i].b = i * 2;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
main1 (arr);
unsigned char b;
} s;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 (s *arr)
{
{
arr[i].a = i;
arr[i].b = i * 2;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
main1 (arr);
s check_res[N];
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 (s *arr)
{
check_res[i].h = arr[i].f;
check_res[i].g = arr[i].f - arr[i].b;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
main1 (arr);
unsigned char h;
} s;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 (s *arr)
{
arr[i].f = i * 2 + 2;
arr[i].g = i - 3;
arr[i].h = 56;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
main1 (arr);
s check_res[N];
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 (s *arr)
{
check_res[i].h = arr[i].c;
check_res[i].g = arr[i].b + arr[i].c;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
main1 (arr);
unsigned char h;
} s;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 (s *arr, int n)
{
arr[i].f = 16;
arr[i].g = 3;
arr[i].h = 56;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
main1 (arr, N-2);
unsigned char h;
} s;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 (s *arr)
{
arr[i].f = i * 5;
arr[i].g = i - 3;
arr[i].h = 56;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
main1 (arr);
s check_res[N];
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 (s *arr)
{
check_res[i].h = arr[i].d;
check_res[i].g = u + t;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
main1 (arr);
unsigned char h;
} s;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 (s *arr)
{
arr[i].f = i * 5;
arr[i].g = i - 3;
arr[i].h = 67;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
main1 (arr);
unsigned char h;
} s;
-volatile int y = 0;
-
__attribute__ ((noinline)) int
main1 (s *arr)
{
arr[i].f = i + 5;
arr[i].g = i + 3;
arr[i].h = 67;
- if (y) /* Avoid vectorization. */
- abort ();
+ asm volatile ("" ::: "memory");
}
main1 (arr);