| 1 |
/* { dg-options "-O3 -fdump-tree-lversion-details" } */ |
| 2 |
/* { dg-require-effective-target size20plus } */ |
| 3 |
|
| 4 |
/* Versioning for step == 1 in these loops would allow loop interchange, |
| 5 |
but otherwise isn't worthwhile. At the moment we decide not to version. */ |
| 6 |
|
| 7 |
void |
| 8 |
f1 (double x[][100], int step, int n) |
| 9 |
{ |
| 10 |
for (int i = 0; i < n; ++i) |
| 11 |
for (int j = 0; j < n; ++j) |
| 12 |
x[j * step][i] = 100; |
| 13 |
} |
| 14 |
|
| 15 |
void |
| 16 |
f2 (double x[][100], int step, int n) |
| 17 |
{ |
| 18 |
for (int i = 0; i < n; ++i) |
| 19 |
for (int j = 0; j < n; ++j) |
| 20 |
x[j][i * step] = 100; |
| 21 |
} |
| 22 |
|
| 23 |
void |
| 24 |
f3 (double x[][100], int step, int limit) |
| 25 |
{ |
| 26 |
for (int i = 0; i < 100; ++i) |
| 27 |
for (int j = 0; j < limit; j += step) |
| 28 |
x[j][i] = 100; |
| 29 |
} |
| 30 |
|
| 31 |
void |
| 32 |
f4 (double x[][100], int step, int limit) |
| 33 |
{ |
| 34 |
for (int i = 0; i < limit; i += step) |
| 35 |
for (int j = 0; j < 100; ++j) |
| 36 |
x[j][i] = 100; |
| 37 |
} |
| 38 |
|
| 39 |
double x[100][100]; |
| 40 |
|
| 41 |
void |
| 42 |
g1 (int step, int n) |
| 43 |
{ |
| 44 |
for (int i = 0; i < n; ++i) |
| 45 |
for (int j = 0; j < n; ++j) |
| 46 |
x[j * step][i] = 100; |
| 47 |
} |
| 48 |
|
| 49 |
void |
| 50 |
g2 (int step, int n) |
| 51 |
{ |
| 52 |
for (int i = 0; i < n; ++i) |
| 53 |
for (int j = 0; j < n; ++j) |
| 54 |
x[j][i * step] = 100; |
| 55 |
} |
| 56 |
|
| 57 |
void |
| 58 |
g3 (int step, int limit) |
| 59 |
{ |
| 60 |
for (int i = 0; i < 100; ++i) |
| 61 |
for (int j = 0; j < limit; j += step) |
| 62 |
x[j][i] = 100; |
| 63 |
} |
| 64 |
|
| 65 |
void |
| 66 |
g4 (int step, int limit) |
| 67 |
{ |
| 68 |
for (int i = 0; i < limit; i += step) |
| 69 |
for (int j = 0; j < 100; ++j) |
| 70 |
x[j][i] = 100; |
| 71 |
} |
| 72 |
|
| 73 |
/* { dg-final { scan-tree-dump-not {want to version} "lversion" } } */ |
| 74 |
/* { dg-final { scan-tree-dump-not {versioned} "lversion" } } */ |