| 1 |
/* { dg-do compile { target size32plus } } */ |
| 2 |
/* The desire is to show we can generate a memset from the outer loop |
| 3 |
store. Both store motion and PRE expose a DSE opportunity for this |
| 4 |
zeroing - while desirable this defeats the purpose of this testcase. */ |
| 5 |
/* { dg-options "-O2 -fno-tree-loop-im -fno-tree-pre -ftree-loop-distribution -ftree-loop-distribute-patterns -fdump-tree-ldist-details" } */ |
| 6 |
|
| 7 |
#define N (1024) |
| 8 |
double a[N][N], b[N][N], c[N][N]; |
| 9 |
|
| 10 |
void |
| 11 |
foo (void) |
| 12 |
{ |
| 13 |
unsigned i, j, k; |
| 14 |
|
| 15 |
for (i = 0; i < N; ++i) |
| 16 |
for (j = 0; j < N; ++j) |
| 17 |
{ |
| 18 |
c[i][j] = 0.0; |
| 19 |
for (k = 0; k < N; ++k) |
| 20 |
c[i][j] += a[i][k] * b[k][j]; |
| 21 |
} |
| 22 |
} |
| 23 |
|
| 24 |
/* { dg-final { scan-tree-dump "Loop nest . distributed: split to 1 loops and 1 library" "ldist" } } */ |