Multi-way Loop Unrolling
i = 0;
while (i < n) {
b[i] =
a[n-i-1];
if (b[i] == 0)
i += 2;
else i++;
}
...
If n is static and has the value 3, the specializer produces:
b[0] = a[2];
if (b[0] == 0)
goto p2;
b[1] = a[1];
if (b[1] == 0)
goto p3;
p2:b[2] = a[0];
p3:...
Previous slide
Next slide
Back to first slide
View graphic version