Visible to Intel only — GUID: GUID-CDCCCACD-A61C-40C5-A342-E452C95E1608
Visible to Intel only — GUID: GUID-CDCCCACD-A61C-40C5-A342-E452C95E1608
O
Specifies the code optimization for applications.
Linux: |
-O[n] |
Windows: |
/O[n] |
n |
Is the optimization level. Possible values are 1, 2, or 3. On Linux* systems, you can also specify 0. |
O2 |
Optimizes for code speed. This default may change depending on which other compiler options are specified. For details, see below. |
This option specifies the code optimization for applications.
Option |
Description |
---|---|
O (Linux*) |
This is the same as specifying O2. |
O0 (Linux) |
Disables all optimizations. This option may set other options. This is determined by the compiler, depending on which operating system and architecture you are using. The options that are set may change from release to release. |
O1 |
Enables optimizations for speed and disables some optimizations that increase code size and affect speed.
This option may set other options. This is determined by the compiler, depending on which operating system and architecture you are using. The options that are set may change from release to release. The O1 option may improve performance for applications with very large code size, many branches, and execution time not dominated by code within loops. |
O2 |
Enables optimizations for speed. This is the generally recommended optimization level. This option also enables:
This option may set other options, especially options that optimize for code speed. This is determined by the compiler, depending on which operating system and architecture you are using. The options that are set may change from release to release. This content does not apply to SYCL. Many routines in the shared libraries are more highly optimized for Intel® microprocessors than for non-Intel microprocessors. |
O3 |
Performs O2 optimizations and enables more aggressive loop transformations such as Fusion, Block-Unroll-and-Jam, and collapsing IF statements. This option may set other options. This is determined by the compiler, depending on which operating system and architecture you are using. The options that are set may change from release to release. The O3 optimizations may not cause higher performance unless loop and memory access transformations take place. The optimizations may slow down code in some cases compared to O2 optimizations. The O3 option is recommended for applications that have loops that heavily use floating-point calculations and process large data sets. Many routines in the shared libraries are more highly optimized for Intel® microprocessors than for non-Intel microprocessors. |
The last O option specified on the command line takes precedence over any others.
Visual Studio: Optimization > Optimization
Eclipse: General > Optimization Level
O0 |
Linux: None |