1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149
|
/* { dg-options "-O3 -fdump-tree-lversion-details" } */
/* Test that we don't try to version for a step of 1 when that would
cause the iterations to overlap. */
void
f1 (unsigned short *x, int stepx, int n)
{
for (int i = 0; i < n; ++i)
{
x[i * stepx] = 100;
x[i * stepx + 1] = 99;
}
}
void
f2 (unsigned short *x, int stepx, int n)
{
for (int i = 0; i < n; i += stepx)
{
x[i] = 100;
x[i + 1] = 99;
}
}
void
f3 (unsigned short *x, int stepx, int n)
{
for (int i = 0; i < n; ++i)
{
x[i * stepx - 16] = 100;
x[i * stepx - 15] = 99;
}
}
void
f4 (unsigned short *x, int stepx, int n)
{
for (int i = 0; i < n; i += stepx)
{
x[i - 16] = 100;
x[i - 15] = 99;
}
}
void
f5 (unsigned short *x, int stepx, int n)
{
for (int i = 0; i < n; ++i)
{
x[i * stepx - 16] = 100;
x[i * stepx + 15] = 99;
}
}
void
f6 (unsigned short *x, int stepx, int n)
{
for (int i = 0; i < n; i += stepx)
{
x[i - 16] = 100;
x[i + 15] = 99;
}
}
void
f7 (unsigned short *x, int stepx, int n)
{
for (unsigned short *y = x; y < x + n; y += stepx)
{
y[0] = 100;
y[1] = 99;
}
}
unsigned short x[1000];
void
g1 (int stepx, int n)
{
for (int i = 0; i < n; ++i)
{
x[i * stepx] = 100;
x[i * stepx + 1] = 99;
}
}
void
g2 (int stepx, int n)
{
for (int i = 0; i < n; i += stepx)
{
x[i] = 100;
x[i + 1] = 99;
}
}
void
g3 (int stepx, int n)
{
for (int i = 0; i < n; ++i)
{
x[i * stepx - 16] = 100;
x[i * stepx - 15] = 99;
}
}
void
g4 (int stepx, int n)
{
for (int i = 0; i < n; i += stepx)
{
x[i - 16] = 100;
x[i - 15] = 99;
}
}
void
g5 (int stepx, int n)
{
for (int i = 0; i < n; ++i)
{
x[i * stepx - 16] = 100;
x[i * stepx + 15] = 99;
}
}
void
g6 (int stepx, int n)
{
for (int i = 0; i < n; i += stepx)
{
x[i - 16] = 100;
x[i + 15] = 99;
}
}
void
g7 (int stepx, int n)
{
for (unsigned short *y = x; y < x + n; y += stepx)
{
y[0] = 100;
y[1] = 99;
}
}
/* { dg-final { scan-tree-dump-not {want to version} "lversion" } } */
/* { dg-final { scan-tree-dump-not {versioned} "lversion" } } */
|