/unroll

Syntax:

/unroll:count

For higher optimization levels, the /unroll option allows you to specify how many times loops are unrolled. If the /unroll option is not specified, the optimizer will choose an unroll amount that minimizes the overhead of prefetching while also limiting code size expansion.

In the visual development environment, specify the Loop Unroll Count in the Optimizations Compiler Option Category.

If the /optimize:3, /optimize:4 (or equivalent), or /optimize:5 options are specified, loop unrolling occurs. The count should be an integer in the range 0 to 16. A count value of 0 is used to indicate that the compiler should determine how many times a loop is unrolled (default).

The compiler attempts to unroll certain innermost loops, minimizing the number of branches and grouping more instructions together to allow efficient overlapped instruction execution (instruction pipelining). The best candidates for loop unrolling are innermost loops with limited control flow.

On ia32 systems, specifying a higher value may improve run-time performance of certain applications. For more information, see Loop Unrolling.

You can specify the number of times a specific loop is unrolled by using the cDEC$ UNROLL Directive to Control Loop Unrolling.