| 1 |
/* Fix for PR119351 alignment peeling with vectors and VLS. */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-options "-Ofast -msve-vector-bits=256 --param aarch64-autovec-preference=sve-only -fdump-tree-vect-details" } */ |
| 4 |
|
| 5 |
#define N 512 |
| 6 |
#define START 2 |
| 7 |
#define END 505 |
| 8 |
|
| 9 |
int x[N] __attribute__((aligned(32))); |
| 10 |
|
| 11 |
int __attribute__((noipa)) |
| 12 |
foo (void) |
| 13 |
{ |
| 14 |
for (signed int i = START; i < END; ++i) |
| 15 |
{ |
| 16 |
if (x[i] == 0) |
| 17 |
return i; |
| 18 |
} |
| 19 |
return -1; |
| 20 |
} |
| 21 |
|
| 22 |
/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" } } */ |
| 23 |
/* { dg-final { scan-tree-dump "pfa_iv_offset" "vect" } } */ |
| 24 |
/* { dg-final { scan-tree-dump "Alignment of access forced using peeling" "vect" } } */ |