Commit b9680369 by Richard Sandiford Committed by Richard Sandiford

Consistently use asm volatile ("" ::: "memory") in vect tests

The vectoriser tests used a combination of:

1) if (impossible condition) abort ();
2) volatile int x; ... *x = ...;
3) asm volatile ("" ::: "memory");

to prevent vectorisation of a set-up loop.  The problem with 1) is that
the compiler can often tell that the condition is false and optimise
it away before vectorisation.

This was already happening in slp-perm-9.c, which is why the test was
expecting one loop to be vectorised even when the required permutes
weren't supported.  It becomes a bigger problem with SVE, which is
able to vectorise more set-up loops.

The point of this patch is therefore to replace 1) with something else.
2) should work most of the time, but we don't usually treat non-volatile
accesses as aliasing unrelated volatile accesses, so I think in principle
we could split the loop into one that does the set-up and one that does
the volatile accesses.  3) seems more robust because it's also a wild
read and write.

The patch therefore tries to replace all instances of 1) and 2) with 3).

2017-11-09  Richard Sandiford  <richard.sandiford@linaro.org>
	    Alan Hayward  <alan.hayward@arm.com>
	    David Sherwood  <david.sherwood@arm.com>

gcc/testsuite/
	* 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.

Co-Authored-By: Alan Hayward <alan.hayward@arm.com>
Co-Authored-By: David Sherwood <david.sherwood@arm.com>

From-SVN: r254588
parent 67cc7a30
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.
......
......@@ -25,9 +25,7 @@ main1 (int dummy)
*pout++ = *pin++;
*pout++ = *pin++;
*pout++ = *pin++;
/* Avoid loop vectorization. */
if (dummy == 32)
abort ();
asm volatile ("" ::: "memory");
}
/* check results: */
......
......@@ -9,7 +9,7 @@
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;
......@@ -25,8 +25,7 @@ void foo (short * __restrict__ dst, short * __restrict__ src, int h,
dst[7] += A*src[7];
dst += stride;
src += stride;
if (dummy == 32)
abort ();
asm volatile ("" ::: "memory");
}
}
......@@ -43,7 +42,7 @@ int main (void)
src[i] = i;
}
foo (dst, src, N, 8, 0);
foo (dst, src, N, 8);
for (i = 0; i < N; i++)
{
......
......@@ -9,7 +9,8 @@
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;
......@@ -25,8 +26,7 @@ void foo (short * __restrict__ dst, short * __restrict__ src, int h, int stride,
dst[7] += A*src[7] + src[7+stride];
dst += 8;
src += 8;
if (dummy == 32)
abort ();
asm volatile ("" ::: "memory");
}
}
......@@ -43,7 +43,7 @@ int main (void)
src[i] = i;
}
foo (dst, src, N, 8, 0);
foo (dst, src, N, 8);
for (i = 0; i < N/2; i++)
{
......
......@@ -10,8 +10,7 @@
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;
......@@ -27,8 +26,7 @@ foo (char * __restrict__ dst, char * __restrict__ src, int h,
dst[7] += A*src[7] + src[7+stride];
dst += 8;
src += 8;
if (dummy == 32)
abort ();
asm volatile ("" ::: "memory");
}
}
......@@ -45,7 +43,7 @@ int main (void)
src[i] = i/8;
}
foo (dst, src, N, 8, 0);
foo (dst, src, N, 8);
for (i = 0; i < N/2; i++)
{
......
......@@ -9,7 +9,8 @@
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;
......@@ -25,8 +26,7 @@ void foo (short * __restrict__ dst, short * __restrict__ src, int h, int stride,
dst[7] = A*src[7] + B*src[8];
dst += stride;
src += stride;
if (dummy == 32)
abort ();
asm volatile ("" ::: "memory");
}
}
......@@ -43,7 +43,7 @@ int main (void)
src[i] = i;
}
foo (dst, src, N, 8, 0);
foo (dst, src, N, 8);
for (i = 0; i < N/2; i++)
{
......
......@@ -28,7 +28,10 @@ int main ()
check_vect ();
for (i = 0; i < N; i++)
a[i] = i;
{
a[i] = i;
asm volatile ("" ::: "memory");
}
foo (a, 4);
......
......@@ -14,7 +14,6 @@ struct extraction
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) {
......@@ -24,9 +23,8 @@ 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. */
......@@ -48,7 +46,6 @@ int main (void)
{
check_vect ();
foo = 0;
return main1 (0, N);
}
......
......@@ -14,7 +14,6 @@ struct extraction
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) {
......@@ -24,9 +23,8 @@ 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. */
......@@ -48,7 +46,6 @@ int main (void)
{
check_vect ();
foo = 0;
return main1 (0, N);
}
......
......@@ -9,7 +9,7 @@
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;
......@@ -19,8 +19,7 @@ main1 (int *a, int *b, int *c, int *d, int dummy)
res[i+1] = b + 16;
res[i+2] = c + 16;
res[i+3] = d + 16;
if (dummy == 32)
abort ();
asm volatile ("" ::: "memory");
}
}
......
......@@ -4,7 +4,6 @@
#include "tree-vect.h"
#define N 64
volatile int y = 0;
int
main1 ()
......@@ -18,8 +17,7 @@ main1 ()
for (i = 0; i < N*8; i++)
{
in[i] = in2[i] = i;
if (y) /* Avoid vectorization. */
abort ();
asm volatile ("" ::: "memory");
}
/* Induction is SLPable. */
......
......@@ -97,8 +97,7 @@ int main (void)
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);
......
......@@ -15,7 +15,6 @@ typedef struct {
unsigned char ub[N*2];
unsigned char uc[N];
volatile int y = 0;
unsigned char check_diff = 2;
void
......@@ -69,13 +68,11 @@ int main (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++)
......@@ -84,8 +81,7 @@ int main (void)
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 ();
......
......@@ -16,8 +16,6 @@ typedef struct {
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)
{
......@@ -69,8 +67,7 @@ int main (void)
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 ();
......
......@@ -6,7 +6,6 @@
#define N 96
unsigned short in[N*8];
volatile int y = 0;
int
main1 ()
......@@ -17,8 +16,7 @@ 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++)
......
......@@ -7,7 +7,6 @@
unsigned short in[N*8];
unsigned short in2[N*8];
volatile int y = 0;
int
main1 ()
......@@ -19,8 +18,7 @@ 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. */
......
......@@ -58,8 +58,7 @@ int main (void)
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);
......
......@@ -49,9 +49,7 @@ int main (void)
arr1[i].a = i;
arr1[i].b = i * 2;
arr1[i].c = (void *)arr1;
if (arr1[i].a == 178)
abort();
asm volatile ("" ::: "memory");
}
......
......@@ -4,7 +4,6 @@
#include "tree-vect.h"
#define N 128
volatile int y = 0;
int
main1 ()
......@@ -17,8 +16,7 @@ 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++)
......
......@@ -13,7 +13,6 @@ struct s
};
char in[N*3];
volatile int y = 0;
__attribute__ ((noinline)) int
main1 ()
......@@ -24,8 +23,7 @@ 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++)
......
......@@ -68,10 +68,8 @@ int main (int argc, const char* argv[])
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);
......
......@@ -57,8 +57,7 @@ int main (int argc, const char* argv[])
input2[i] = i%256;
output[i] = 0;
output2[i] = 0;
if (input[i] > 200)
abort ();
asm volatile ("" ::: "memory");
}
foo (input, output, input2, output2);
......@@ -70,7 +69,7 @@ int main (int argc, const char* argv[])
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 } } } } */
......
......@@ -33,8 +33,7 @@ int main (int argc, const char* argv[])
{
input[i] = i;
output[i] = 0;
if (input[i] > 256)
abort ();
asm volatile ("" ::: "memory");
}
for (i = 0; i < N / 3; i++)
......@@ -54,8 +53,8 @@ int main (int argc, const char* argv[])
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 } } } } } */
......
......@@ -8,8 +8,6 @@ extern void abort (void);
short a[N];
short d[N];
volatile int y = 0;
int foo ()
{
int i;
......@@ -19,10 +17,7 @@ int foo ()
{
b[i] = i*3;
c[i] = i;
/* Avoid vectorization. */
if (y)
abort ();
asm volatile ("" ::: "memory");
}
/* Strided access pattern. */
......
......@@ -15,7 +15,6 @@ struct extraction
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) {
......@@ -25,10 +24,9 @@ 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. */
......@@ -50,7 +48,6 @@ int main (void)
{
check_vect ();
foo = 0;
return main1 (0, N);
}
......
......@@ -16,7 +16,6 @@ struct extraction
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) {
......@@ -30,8 +29,7 @@ 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");
}
}
......@@ -60,7 +58,6 @@ int main (void)
{
check_vect ();
foo = 0;
return main1 (N);
}
......
......@@ -16,8 +16,6 @@ static int a[N][N];
static int b[N][N];
static int c[N][N];
volatile int y;
__attribute__ ((noinline))
int main1 (int x) {
int i,j, off;
......@@ -29,8 +27,7 @@ int main1 (int x) {
{
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++)
......@@ -38,8 +35,7 @@ int main1 (int x) {
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++)
......@@ -53,8 +49,7 @@ int main1 (int x) {
*(&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");
}
}
......@@ -64,10 +59,7 @@ int main1 (int x) {
{
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");
}
}
......
......@@ -16,8 +16,6 @@ static int a[N][N] = {{1,2,3,11},{4,5,6,12},{7,8,9,13},{34,45,67,83}};
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;
......@@ -30,10 +28,7 @@ int main1 (int x) {
{
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");
}
}
......
......@@ -8,8 +8,6 @@
char cb[N];
char cc[N];
volatile int y = 0;
__attribute__ ((noinline)) int
main1 (void)
{
......@@ -20,9 +18,7 @@ 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. */
......
......@@ -17,8 +17,6 @@ static int c[N][N] = {{ 1, 2, 3, 4, 5},
{34,38,42,46,50},
{55,60,65,70,75}};
volatile int foo;
__attribute__ ((noinline))
int main1 (int A[N][N], int n)
{
......@@ -43,7 +41,6 @@ int main (void)
check_vect ();
foo = 0;
main1 (a, N);
/* check results: */
......
......@@ -5,8 +5,6 @@
#define N 128
volatile int y = 0;
__attribute__ ((noinline))
int main1 ()
{
......@@ -17,8 +15,7 @@ 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). */
......
......@@ -9,8 +9,6 @@
char cb[N];
char ca[N];
volatile int y = 0;
__attribute__ ((noinline))
int main1 ()
{
......@@ -19,9 +17,7 @@ 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++)
......
......@@ -10,8 +10,6 @@ struct {
} s;
char cb[N];
volatile int y = 0;
__attribute__ ((noinline))
int main1 ()
{
......@@ -20,9 +18,7 @@ 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++)
{
......
......@@ -12,8 +12,6 @@ float e[N] = {0};
float b[N];
float c[N];
volatile int y = 0;
__attribute__ ((noinline))
int main1 ()
{
......@@ -25,17 +23,13 @@ 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++)
......
......@@ -11,8 +11,6 @@ int ib[N];
#define ia (ic+N)
volatile int y = 0;
__attribute__ ((noinline))
int main1 ()
{
......@@ -21,8 +19,7 @@ int main1 ()
for (i = 0; i < N; i++)
{
ib[i] = i*3;
if (y)
abort ();
asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
......
......@@ -13,8 +13,6 @@ float a[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
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)
{
......@@ -25,14 +23,12 @@ 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++)
......
......@@ -12,8 +12,6 @@
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)
{
......@@ -23,8 +21,7 @@ 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++)
{
......
......@@ -13,8 +13,6 @@
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)
{
......@@ -24,8 +22,7 @@ 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++)
......
......@@ -13,8 +13,6 @@ float fc[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
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)
{
......@@ -24,14 +22,12 @@ 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++)
......
......@@ -8,8 +8,6 @@
char x[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
char cb[N] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
volatile int y = 0;
__attribute__ ((noinline))
int main1 ()
{
......@@ -21,8 +19,7 @@ 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
......
......@@ -9,8 +9,6 @@
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])
{
......@@ -41,9 +39,7 @@ int main (void)
for (j = 0; j < N; j++)
{
ia[i][j] = i + j + 1;
/* Avoid vectorization. */
if (y)
abort ();
asm volatile ("" ::: "memory");
}
check_vect ();
......
......@@ -78,8 +78,6 @@ char cb[N] = {0,3,6,9,12,15,18,21,24,27,30,33,36,39,42,45};
char ca[N];
short sa[N];
volatile int y = 0;
/* All of the loops below are currently vectorizable, except
initialization ones. */
......@@ -101,8 +99,7 @@ main1 ()
fmul_results[i] = b[i] * c[i];
fresults1[i] = 0;
fresults2[i] = 0;
if (y)
abort ();
asm volatile ("" ::: "memory");
}
/* Test 1: copy chars. */
......@@ -142,15 +139,13 @@ main1 ()
{
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++)
......
......@@ -4,8 +4,6 @@
#define N 128
volatile int y = 0;
static inline void
vfoo16 (unsigned short int* a)
{
......@@ -27,8 +25,7 @@ main (void)
{
arr[i] = i;
expect[i] = __builtin_bswap16 (i);
if (y) /* Avoid vectorisation. */
abort ();
asm volatile ("" ::: "memory");
}
vfoo16 (arr);
......
......@@ -4,8 +4,6 @@
#define N 128
volatile int y = 0;
static inline void
vfoo32 (unsigned int* a)
{
......@@ -27,8 +25,7 @@ main (void)
{
arr[i] = i;
expect[i] = __builtin_bswap32 (i);
if (y) /* Avoid vectorisation. */
abort ();
asm volatile ("" ::: "memory");
}
vfoo32 (arr);
......
......@@ -4,8 +4,6 @@
#define N 128
volatile int y = 0;
static inline void
vfoo64 (unsigned long long* a)
{
......@@ -27,8 +25,7 @@ main (void)
{
arr[i] = i;
expect[i] = __builtin_bswap64 (i);
if (y) /* Avoid vectorisation. */
abort ();
asm volatile ("" ::: "memory");
}
vfoo64 (arr);
......
......@@ -9,8 +9,6 @@ int in[2*K][K] __attribute__ ((__aligned__(__BIGGEST_ALIGNMENT__)));
int out[K];
int check_result[K];
volatile int y = 0;
__attribute__ ((noinline)) void
foo ()
{
......@@ -24,9 +22,7 @@ foo ()
for (i = 0; i < K; i++)
{
sum *= in[i+k][j];
/* Avoid vectorization. */
if (y)
abort ();
asm volatile ("" ::: "memory");
}
check_result[k] = sum;
}
......
......@@ -9,8 +9,6 @@ unsigned char ub[N];
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)
{
......@@ -33,9 +31,7 @@ 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]);
......
......@@ -4,7 +4,6 @@
#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)
......@@ -30,9 +29,7 @@ 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++) {
......
......@@ -7,8 +7,6 @@
unsigned char udata_ch[N];
#define SUM N*(N-1)
volatile int y = 0;
__attribute__ ((noinline)) int
foo ()
{
......@@ -18,9 +16,7 @@ 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. */
......
......@@ -7,8 +7,6 @@
unsigned char udata_ch[N];
#define SUM N*(N-1)
volatile int y = 0;
__attribute__ ((noinline)) int
foo ()
{
......@@ -18,9 +16,7 @@ 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. */
......
......@@ -6,8 +6,6 @@
#define N 128
signed char data_ch[N];
volatile int y = 0;
__attribute__ ((noinline)) int
foo ()
{
......@@ -19,9 +17,7 @@ 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. */
......
......@@ -15,8 +15,6 @@ typedef struct {
unsigned int b;
} ii;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 ()
{
......@@ -34,8 +32,7 @@ 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++)
......
......@@ -10,8 +10,6 @@ typedef struct {
unsigned short b;
} s;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 ()
{
......@@ -24,8 +22,7 @@ main1 ()
{
arr[i].a = i;
arr[i].b = i * 2;
if (y) /* Avoid vectorization. */
abort ();
asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
......
......@@ -12,8 +12,6 @@ typedef struct {
unsigned short d;
} s;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 ()
{
......@@ -28,8 +26,7 @@ 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++)
......
......@@ -10,8 +10,6 @@ typedef struct {
unsigned short b;
} s;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 ()
{
......@@ -28,8 +26,7 @@ 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++)
......
......@@ -10,8 +10,6 @@ typedef struct {
unsigned char b;
} s;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 ()
{
......@@ -24,8 +22,7 @@ main1 ()
{
arr[i].a = i;
arr[i].b = i * 2;
if (y) /* Avoid vectorization. */
abort ();
asm volatile ("" ::: "memory");
}
for (i = 0; i < N; i++)
......
......@@ -16,8 +16,6 @@ typedef struct {
unsigned char h;
} s;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 ()
{
......@@ -47,8 +45,7 @@ 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++)
......
......@@ -16,8 +16,6 @@ typedef struct {
unsigned char h;
} s;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 ()
{
......@@ -36,8 +34,7 @@ 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++)
......
......@@ -16,8 +16,6 @@ typedef struct {
unsigned char h;
} s;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 ()
{
......@@ -52,8 +50,7 @@ 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++)
......
......@@ -16,8 +16,6 @@ typedef struct {
unsigned char h;
} s;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 ()
{
......@@ -37,8 +35,7 @@ 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++)
......
......@@ -15,8 +15,6 @@ typedef struct {
unsigned int b;
} ii;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 (s *arr, ii *iarr)
{
......@@ -64,8 +62,7 @@ int main (void)
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);
......
......@@ -15,8 +15,6 @@ typedef struct {
unsigned int b;
} ii;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 (s *arr, ii *iarr)
{
......@@ -64,8 +62,7 @@ int main (void)
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);
......
......@@ -12,8 +12,6 @@ typedef struct {
s buffer1[N], buffer2[N];
volatile int y = 0;
__attribute__ ((noinline)) int
main1 (s * __restrict__ pIn, s* __restrict__ pOut)
{
......@@ -63,8 +61,7 @@ int main (void)
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 ();
......
......@@ -10,8 +10,6 @@ typedef struct {
unsigned short b;
} s;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 (s *arr)
{
......@@ -48,8 +46,7 @@ int main (void)
{
arr[i].a = i;
arr[i].b = i * 2;
if (y) /* Avoid vectorization. */
abort ();
asm volatile ("" ::: "memory");
}
main1 (arr);
......
......@@ -12,8 +12,6 @@ typedef struct {
unsigned short d;
} s;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 (s *arr)
{
......@@ -61,8 +59,7 @@ int main (void)
arr[i].b = i * 2;
arr[i].c = 17;
arr[i].d = i+34;
if (y) /* Avoid vectorization. */
abort ();
asm volatile ("" ::: "memory");
}
main1 (arr);
......
......@@ -12,8 +12,6 @@ typedef struct {
int d;
} s;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 (s *arr)
{
......@@ -56,8 +54,7 @@ int main (void)
arr[i].b = i * 2;
arr[i].c = 17;
arr[i].d = i+34;
if (y) /* Avoid vectorization. */
abort ();
asm volatile ("" ::: "memory");
}
main1 (arr);
......
......@@ -16,8 +16,6 @@ typedef struct {
int h;
} s;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 (s *arr)
{
......@@ -70,8 +68,7 @@ int main (void)
arr[i].f = i * 5;
arr[i].g = i - 3;
arr[i].h = 56;
if (y) /* Avoid vectorization. */
abort ();
asm volatile ("" ::: "memory");
}
main1 (arr);
......
......@@ -10,8 +10,6 @@ typedef struct {
unsigned char b;
} s;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 (s *arr)
{
......@@ -64,8 +62,7 @@ int main (void)
{
arr[i].a = i;
arr[i].b = i * 2;
if (y) /* Avoid vectorization. */
abort ();
asm volatile ("" ::: "memory");
}
main1 (arr);
......
......@@ -10,8 +10,6 @@ typedef struct {
unsigned char b;
} s;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 (s *arr)
{
......@@ -47,8 +45,7 @@ int main (void)
{
arr[i].a = i;
arr[i].b = i * 2;
if (y) /* Avoid vectorization. */
abort ();
asm volatile ("" ::: "memory");
}
main1 (arr);
......
......@@ -18,8 +18,6 @@ typedef struct {
s check_res[N];
volatile int y = 0;
__attribute__ ((noinline)) int
main1 (s *arr)
{
......@@ -83,8 +81,7 @@ int main (void)
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);
......
......@@ -16,8 +16,6 @@ typedef struct {
unsigned char h;
} s;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 (s *arr)
{
......@@ -71,8 +69,7 @@ int main (void)
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);
......
......@@ -18,8 +18,6 @@ typedef struct {
s check_res[N];
volatile int y = 0;
__attribute__ ((noinline)) int
main1 (s *arr)
{
......@@ -105,8 +103,7 @@ int main (void)
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);
......
......@@ -16,8 +16,6 @@ typedef struct {
unsigned char h;
} s;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 (s *arr, int n)
{
......@@ -103,8 +101,7 @@ int main (void)
arr[i].f = 16;
arr[i].g = 3;
arr[i].h = 56;
if (y) /* Avoid vectorization. */
abort ();
asm volatile ("" ::: "memory");
}
main1 (arr, N-2);
......
......@@ -16,8 +16,6 @@ typedef struct {
unsigned char h;
} s;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 (s *arr)
{
......@@ -91,8 +89,7 @@ int main (void)
arr[i].f = i * 5;
arr[i].g = i - 3;
arr[i].h = 56;
if (y) /* Avoid vectorization. */
abort ();
asm volatile ("" ::: "memory");
}
main1 (arr);
......
......@@ -18,8 +18,6 @@ typedef struct {
s check_res[N];
volatile int y = 0;
__attribute__ ((noinline)) int
main1 (s *arr)
{
......@@ -93,8 +91,7 @@ int main (void)
check_res[i].h = arr[i].d;
check_res[i].g = u + t;
if (y) /* Avoid vectorization. */
abort ();
asm volatile ("" ::: "memory");
}
main1 (arr);
......
......@@ -16,8 +16,6 @@ typedef struct {
unsigned char h;
} s;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 (s *arr)
{
......@@ -76,8 +74,7 @@ int main (void)
arr[i].f = i * 5;
arr[i].g = i - 3;
arr[i].h = 67;
if (y) /* Avoid vectorization. */
abort ();
asm volatile ("" ::: "memory");
}
main1 (arr);
......
......@@ -16,8 +16,6 @@ typedef struct {
unsigned char h;
} s;
volatile int y = 0;
__attribute__ ((noinline)) int
main1 (s *arr)
{
......@@ -78,8 +76,7 @@ int main (void)
arr[i].f = i + 5;
arr[i].g = i + 3;
arr[i].h = 67;
if (y) /* Avoid vectorization. */
abort ();
asm volatile ("" ::: "memory");
}
main1 (arr);
......
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