Global Optimizations

To enable global optimizations, use /optimize:2 or a higher optimization level. Using /optimize:2 or higher also enables local optimizations (/optimize:1).

Global optimizations include:

Data-flow and split lifetime analysis (global data analysis) traces the values of variables and whole arrays as they are created and used in different parts of a program unit. During this analysis, Visual Fortran assumes that any pair of array references to a given array might access the same memory location, unless constant subscripts are used in both cases.

To eliminate unnecessary recomputations of invariant expressions in loops, Visual Fortran hoists them out of the loops so they execute only once.

Global data analysis includes which data items are selected for analysis. Some data items are analyzed as a group and some are analyzed individually. Visual Fortran limits or may disqualify data items that participate in the following constructs, generally because it cannot fully trace their values.

Data items in the following declarations can make global optimizations less effective: