Software pipelining.

Register reassociation.

Level 2 can produce faster runtime code than level 1 if programs use loops extensively. Loop-oriented floating-point intensive applications may see run times reduced by 50%.

Operating system and interactive applications that use the already optimized system libraries can achieve 30% to 50% additional improvement. Level 2 optimization produces faster programs than level 1 and compiles faster than level 3 optimization.

Level 3 Optimization

Level 3 optimization includes level 2 optimizations, along with full optimization across all subprograms within a single file. Level 3 also inlines certain subprograms within the input file. Use +O3 to get level 3 optimization.

Level 3 optimization produces faster runtime code than level 2 on code that does many procedure calls to small functions. Level 3 links faster than level 4. But level 3 does not work with the debugger options -g0and -g1.

Level 4 Optimization

Level 4 optimization includes level 3 optimizations, along with full optimizations across the entire application program. Level 4 includes global and static variable optimization and inlining across the entire program. Optimizations are performed at link time rather than at compile time. Use +O4 to get level 4 optimization.

Level 4 optimization produces faster runtime code than level 3 if programs use many global variables or if there are many opportunities for inlining procedure calls. But level 4 does not work with the debugger options -g0and -g1.

Additional Options for Finer Control

In addition to basic optimization levels, optimization options are provided should you require a more precise level of control.

Some introductory examples follow:

Enabling Aggressive Optimizations

To enable aggressive optimizations at the second, third, or fourth optimization levels, use the +Ofast option as follows:

aCC +Ofast +O2 sourcefile.C

or:

aCC +Ofast +O3 sourcefile.C

or:

aCC +Ofast +O4 sourcefile.C

This option enables additional optimizations at each level.

NOTE: Use aggressive optimizations with stable, well-structured code. These types of optimizations give you faster code, but may change the behavior of programs.

These optimizations may do any of the following:

Relocate conditional floating-point instructions from within loops

Convert certain library calls to millicode and inline instructions

Alter error-handling requirements

Requesting Optimization 157