Next: , Previous: Pragma Loop_Invariant, Up: Implementation Defined Pragmas


Pragma Loop_Optimize

Syntax:

     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:

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.