Depending on the Intel architecture, optimization can have different effects. To specify optimizations for your target architecture, refer to the tables below.
Option | Effect |
---|---|
-O1 | Optimizes for code size by turning off software pipelining. Enables the same optimizations as -O except for loop unrolling and software pipelining. -O and -O2 turn on software pipelining. Generally, -O or -O2 are recommended over -O1. |
Option | Effect |
---|---|
-O, -O1, -O2 |
Optimize for speed. Disable option -fp. The -O2 option is ON by default. Intrinsic recognition is disabled. |
-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 (IA-32 only), this option causes the compiler to perform more aggressive data dependency analysis than for -O2. This may result in longer compilation times. |
Option | Effect |
---|---|
-O2 | ON by default. -O2 turns ON intrinsics inlining.
Enables the following capabilities for performance gain:
|
-O3 | Enables -O2 option with more aggressive optimization, for example, prefetching, scalar replacement, and loop transformations. Optimizes for maximum speed, but does not guarantee higher performance unless loop and memory access transformation take place. To time your application, see Timing Your Application. |