XL Fortran for AIX 8.1

User's Guide


The Philosophy of XL Fortran Optimizations

XL Fortran optimizations can be characterized according to their aggressiveness, which determines how much risk they carry. Only the very highest optimization level performs aggressive optimizations, and even then the risk is limited to slightly different results in a small subset of possible programs.

The less-aggressive optimizations are intended to produce exactly the same results as an equivalent unoptimized program:

As the optimization level increases, these restrictions are relaxed where there is an opportunity for a performance improvement:

When you specify the highest level of optimization, XL Fortran assumes that you are requesting speed even at the possibility of some risk, as already explained. If you want as much optimization as possible without the resulting risk, you must add the -qstrict compiler option.

In the past, the XL family of compilers adopted a conservative approach to optimization. This was intended to make an optimized program work exactly the same as an unoptimized one even in extreme cases unlikely to occur in real life. For example, the array reference A(N) might not be optimized, because N might be a huge number so that the program causes a segmentation violation when the address is referenced, and this behavior would be "preserved". With the industry in general favoring a less conservative approach, XL Fortran's highest optimization level now emphasizes performance over identical execution between optimized and unoptimized programs.

The different levels of the -O option incorporate various optimization techniques that are expected to improve performance for many different kinds of programs. The specialized optimization options, such as -qipa, -qhot, and -Q, can improve performance in some kinds of programs but degrade it in others. Therefore, they may require experimentation to determine whether they are appropriate for any given program.


Footnotes:

4
If IEEE compliance is a concern for you, you should also specify either -qfloat=nomaf or -qfloat=rrm.


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]