| 1 |
/* { dg-do compile } */ |
| 2 |
/* { dg-options "-O2 -fno-strict-aliasing -ftree-loop-distribution -fdump-tree-ldist-details" } */ |
| 3 |
|
| 4 |
struct desc { |
| 5 |
int i; |
| 6 |
void * __restrict__ data; |
| 7 |
int j; |
| 8 |
} a, b; |
| 9 |
|
| 10 |
float foo (int n) |
| 11 |
{ |
| 12 |
int i; |
| 13 |
float * __restrict__ x, * __restrict__ y, tmp = 0.0; |
| 14 |
x = (float * __restrict__)a.data; |
| 15 |
y = (float * __restrict__)b.data; |
| 16 |
for (i = 0; i < n; ++i) |
| 17 |
{ |
| 18 |
x[i] = 0.0; |
| 19 |
tmp += y[i]; |
| 20 |
} |
| 21 |
return tmp; |
| 22 |
} |
| 23 |
|
| 24 |
/* Distributing the loop doesn't expose more parallelism. */ |
| 25 |
/* { dg-final { scan-tree-dump-not "Loop 1 distributed: split to 2 loops" "ldist" } } */ |