OPTIMIZATIONS
Function
-Cu[=i<number>]
<number>: number of iterations for unrolling, between 0 and 1024
None
None
#pragma LOOP_UNROLL: Force Loop Unrolling
#pragma NO_LOOP_UNROLL: Disable Loop Unrolling
Enables loop unrolling with the following restrictions:
for (i=0; i<10; i++)
-Cu int i, j; j = 0; for (i=0; i<3; i++) { j += i; }
With the -Cu compiler option given, the Compiler issues an information message 'Unrolling loop' and transforms this loop as shown in the following listing.
j += 1; j += 2; i = 3;
The Compiler also transforms some special loops, i.e., loops with a constant condition or loops with only one pass:
for (i=1; i>3; i++) { j += i; }
The Compiler issues an information message 'Constant condition found, removing loop' and transforms the loop into a simple assignment, because the loop body is never executed:
i=1;
for (i=1; i<2; i++) { j += i; }
Because the loop body is executed only once, the Compiler issues a warning 'Unrolling loop' and transforms the for loop into:
j += 1;
i = 2;