Loop Unrolling Support

The UNROLL[n] directive tells the compiler how many times to unroll a counted loop.

The n is an integer constant from 0 through 255.

The UNROLL directive must precede the DO statement for each DO loop it affects.

If n is specified, the optimizer unrolls the loop n times. If n is omitted or if it is outside the allowed range, the optimizer assigns the number of times to unroll the loop.

The UNROLL directive overrides any setting of loop unrolling from the command line.

Currently, the directive can be applied only for the innermost loop nest. If applied to the outer loop nests, it is ignored. The compiler generates correct code by comparing n and the loop count.

do i = 1, m
b(i) = a(i) + 1
d(i) = c(i) + 1

For more details on these directives, see "Directive Enhanced Compilation", section "General Directives", in the Intel® Fortran Language Reference.