| 1 |
/* Disabling epilogues until we find a better way to deal with scans. */ |
| 2 |
/* { dg-additional-options "--param vect-epilogues-nomask=0" } */ |
| 3 |
/* { dg-require-effective-target vect_int } */ |
| 4 |
/* { dg-additional-options "-fno-tree-scev-cprop" } */ |
| 5 |
|
| 6 |
#include "tree-vect.h" |
| 7 |
|
| 8 |
/* Statement in SLP vectorization used outside the loop. |
| 9 |
NOTE: SCEV disabled to ensure the live operation is not removed before |
| 10 |
vectorization. */ |
| 11 |
#define LIVELOOP(RET) \ |
| 12 |
__attribute__ ((noinline)) int \ |
| 13 |
liveloop##RET (int n, int *x, int *y) \ |
| 14 |
{ \ |
| 15 |
int n0, n1, j; \ |
| 16 |
for (j = 0; j < n; ++j) \ |
| 17 |
{ \ |
| 18 |
n0 = x[(j*2)]; \ |
| 19 |
n1 = x[(j*2)+1]; \ |
| 20 |
y[(j*2)] = n0 + 1; \ |
| 21 |
y[(j*2)+1] = n1 + 2; \ |
| 22 |
} \ |
| 23 |
return n##RET; \ |
| 24 |
} |
| 25 |
|
| 26 |
LIVELOOP (0) |
| 27 |
LIVELOOP (1) |
| 28 |
typedef int (*FP)(int n, int *x, int *y); |
| 29 |
const FP llf[]= {&liveloop0, &liveloop1}; |
| 30 |
|
| 31 |
#define MAX 137 |
| 32 |
|
| 33 |
int |
| 34 |
main (void) |
| 35 |
{ |
| 36 |
int a[MAX*4]; |
| 37 |
int b[MAX*4]; |
| 38 |
int i; |
| 39 |
|
| 40 |
check_vect (); |
| 41 |
|
| 42 |
for (i=0; i<MAX*2; i++) |
| 43 |
{ |
| 44 |
__asm__ volatile (""); |
| 45 |
a[i] = i; |
| 46 |
} |
| 47 |
|
| 48 |
#pragma GCC novector |
| 49 |
for (i=0; i<2; i++) |
| 50 |
{ |
| 51 |
__asm__ volatile (""); |
| 52 |
|
| 53 |
int ret = llf[i] (MAX, a, b); |
| 54 |
|
| 55 |
if (ret != (MAX * 2) - 2 + i) |
| 56 |
abort (); |
| 57 |
|
| 58 |
#pragma GCC novector |
| 59 |
for (i=0; i<MAX*2; i++) |
| 60 |
{ |
| 61 |
__asm__ volatile (""); |
| 62 |
if (b[i] != i + (i%2) + 1) |
| 63 |
abort (); |
| 64 |
} |
| 65 |
} |
| 66 |
} |
| 67 |
|
| 68 |
/* { dg-final { scan-tree-dump-times "vectorized 1 loops" 2 "vect" } } */ |
| 69 |
/* { dg-final { scan-tree-dump-times "vectorizing stmts using SLP" 2 "vect" } } */ |
| 70 |
/* { dg-final { scan-tree-dump-times "vec_stmt_relevant_p: stmt live but not relevant" 2 "vect" } } */ |