pragma Loop_Optimize (OPTIMIZATION_HINT {, OPTIMIZATION_HINT}); OPTIMIZATION_HINT ::= No_Unroll | Unroll | No_Vector | Vector
This pragma must appear immediately within a loop statement. It allows the programmer to specify optimization hints for the enclosing loop. The hints are not mutually exclusive and can be freely mixed, but not all combinations will yield a sensible outcome.
There are four supported optimization hints for a loop:
The loop must not be unrolled. This is a strong hint: the compiler will not unroll a loop marked with this hint.
The loop should be unrolled. This is a weak hint: the compiler will try to apply unrolling to this loop preferably to other optimizations, notably vectorization, but there is no guarantee that the loop will be unrolled.
The loop must not be vectorized. This is a strong hint: the compiler will not vectorize a loop marked with this hint.
The loop should be vectorized. This is a weak hint: the compiler will try to apply vectorization to this loop preferably to other optimizations, notably unrolling, but there is no guarantee that the loop will be vectorized.
These hints do not void the need to pass the appropriate switches to the compiler in order to enable the relevant optimizations, that is to say -funroll-loops for unrolling and -ftree-vectorize for vectorization.