Oracle® Solaris Studio 12.4: C User's Guide

Exit Print View

Updated: March 2015
 
 

2.11.25 unroll

#pragma unroll (unroll_factor)

This pragma accepts a positive constant integer value for the argument unroll_factor. Setting unroll_factor other than 1 serves as a suggestion to the compiler that the specified loop should be unrolled by the given factor when possible. If unroll_factor is 1, this directive commands the compiler that the not to unroll the loop. The compiler takes advantage of this information at optimization levels 3 or above.

The scope of this pragma begins with the pragma and ends with whichever of the following situations occurs first: the beginning of the next block, the next for loop within the current block, the end of the current block. The pragma applies to the next for loop prior to the end of the pragma's scope.