| 1 |
/* { dg-add-options vect_early_break } */ |
| 2 |
/* { dg-do compile } */ |
| 3 |
/* { dg-require-effective-target vect_early_break } */ |
| 4 |
/* { dg-require-effective-target vect_int } */ |
| 5 |
|
| 6 |
/* { dg-additional-options "-Ofast" } */ |
| 7 |
|
| 8 |
/* This will fail because we cannot SLP the load groups yet. */ |
| 9 |
/* { dg-final { scan-tree-dump "LOOP VECTORIZED" "vect" { target { vect_partial_vectors && vect_load_lanes } } } } */ |
| 10 |
/* { dg-final { scan-tree-dump-not "LOOP VECTORIZED" "vect" { target { { ! vect_partial_vectors } || { ! vect_load_lanes } } } } } */ |
| 11 |
|
| 12 |
#define N 1024 |
| 13 |
unsigned vect_a[N]; |
| 14 |
unsigned vect_b[N]; |
| 15 |
|
| 16 |
unsigned test4(unsigned x) |
| 17 |
{ |
| 18 |
unsigned ret = 0; |
| 19 |
for (int i = 0; i < (N/2); i+=2) |
| 20 |
{ |
| 21 |
vect_b[i] = x + i; |
| 22 |
vect_b[i+1] = x + i+1; |
| 23 |
if (vect_a[i] > x || vect_a[i+1] > x) |
| 24 |
break; |
| 25 |
vect_a[i] += x * vect_b[i]; |
| 26 |
vect_a[i+1] += x * vect_b[i+1]; |
| 27 |
} |
| 28 |
return ret; |
| 29 |
} |