| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-add-options vect_early_break } */ |
| 3 |
/* { dg-require-effective-target vect_early_break } */ |
| 4 |
/* { dg-require-effective-target vect_int } */ |
| 5 |
|
| 6 |
/* { dg-final { scan-tree-dump "vectorizing stmts using SLP" "vect" } } */ |
| 7 |
/* { dg-final { scan-tree-dump "Loop contains only SLP stmts" "vect" } } */ |
| 8 |
|
| 9 |
#define N 1024 |
| 10 |
unsigned vect_a[N]; |
| 11 |
unsigned vect_b[N]; |
| 12 |
|
| 13 |
unsigned test4(unsigned x) |
| 14 |
{ |
| 15 |
unsigned ret = 0; |
| 16 |
for (int i = 0; i < N; i++) |
| 17 |
{ |
| 18 |
vect_b[i] = x + i; |
| 19 |
if (vect_a[i] > x) |
| 20 |
{ |
| 21 |
ret *= vect_a[i]; |
| 22 |
return vect_a[i]; |
| 23 |
} |
| 24 |
vect_a[i] = x; |
| 25 |
ret += vect_a[i] + vect_b[i]; |
| 26 |
} |
| 27 |
return ret; |
| 28 |
} |