Crossware

Table of Contents        Previous topic       Next topic       

C/C++ COMPILER->Compiler command line options->Loop Transformation (/Ol)

The /Ol option tells the compiler to consider transforming for and while types of loops into do type loops (although the loop identification is done at a low level rather than at the C source code level and so the loops need not result from for and while statements).

This optimization can lead to a speed improvement since the loop controlling expression is moved to the end of the loop.  This avoids the need for an unconditional branch back to the beginning of the loop to the loop controlling expression.

Further speed improvement might result when this optimization is used in combination with conditional constant propogation.  In some cases the loop can be eliminated entirely.