Scalar Replacement

The goal of scalar replacement, which is enabled by -scalar_rep, is to reduce memory references. This is done mainly by replacing array references with register references.

While the compiler replaces some array references with register references when -O1 or -O2 is specified, more aggressive replacement is performed when -O3 and -scalar_rep are specified. For example, with -O3 the compiler attempts replacement when there are loop-carried dependences or when data-dependence analysis is required for memory disambiguation.

The -scalar_rep compiler option enables (default) scalar replacement performed during loop transformations. The -scalar_rep- option disables this scalar replacement.