Setting Optimization Levels

For IA-32 and Itanium(TM) architectures, the options can behave in a different way. To specify the optimizations for your program, use options depending on the target architecture as explained in the tables that follow.

Itanium Compiler

Option

Effect

-O or -O1

Optimize to favor code size.  Enable the same optimizations as -O2 except for loop unrolling.  -O1 turns off software pipelining to reduce the code size. -O and -O2 turn the software pipelining ON.

IA-32 Compiler

Option

Effect

-O,-O1, -O2

Optimize to favor code speed. Disable option -fp. The -O2 option is ON by default. Inlines intrinsics. Generally, -O2 is recommended over -O1.

-O3

Enables -O2 option with more aggressive optimization. Optimizes for maximum speed, but does not guarantee higher performance unless loop and memory access transformation take place. In conjunction with -axK and -xK options, this option causes the compiler to perform more aggressive data dependency analysis than for -O2. This may result in longer compilation times.

IA-32 and Itanium Compilers

For IA-32 and Itanium architectures, the options can behave in a different way. To specify the optimizations for your program, use options depending on the target architecture as follows.

Option

Effect

-O2

ON by default. -O2 turns ON intrinsics inlining. Enables the following capabilities for performance gain:

  • constant propagation

  • copy propagation

  • dead-code elimination

  • global register allocation

  • global instruction scheduling and control speculation

  • loop unrolling

  • optimized code selection

  • partial redundancy elimination

  • strength reduction/induction variable simplification

  • variable renaming

  • predication

  • software pipelining

-O3

Enables -O2 option with more aggressive optimization. Optimizes for maximum speed, but may not improve performance for some programs.