|
Optimization Level (
-opt)
|
Specify the optimizations that you want the compiler to apply to the generated object code:
- 0
- Disable optimizations. This setting is equivalent to specifying the -O0 command-line option. The compiler generates unoptimized, linear assembly-language code.
- 1
- The compiler performs all target independent optimizations, such as function inlining. This setting is equivalent to specifying the -O1 command-line option. The compiler omits all target-specific optimizations and generates linear assembly-language code.
- 2
- The compiler performs all optimizations (both target-independent and target-specific). This setting is equivalent to specifying the -O2 command-line option. The compiler outputs optimized, non-linear assembly-language code.
- 3
- The compiler performs all the level 2 optimizations and iterates over target-independent and specific optimizations. This setting is equivalent to specifying the -O3 command-line option. At this optimization level, the compiler generates code that is usually faster than the code generated from level 2 optimizations.
- 4
- Like level 3, but with more comprehensive optimizations from levels 1 and 2. Equivalent to #pragma optimization_level 4.
At this optimization level, the compiler generates code that is usually faster than the code generated from level 2 optimizations.
|
|
Speed vs Size
|
Use to specify an
Optimization Level
greater than
0
.
- Speed -
The compiler optimizes object code at the specified
Optimization Level
such that the resulting binary file has a faster execution speed, as opposed to a smaller executable code size.
- Size -
The compiler optimizes object code at the specified
Optimization Level
such that the resulting binary file has a smaller executable code size, as opposed to a faster execution speed. This setting is equivalent to specifying the -Os command-line option.
|
|
IPA
|
Use this option to control the interprocedural analysis optimization.
- Off
- No interprocedural analysis, but still performs function-level optimization. Equivalent to the "no deferred inlining" compilation policy of older compilers.
- File
- Completely parse each translation unit before generating any code or data. Equivalent to the "deferred inlining" option of older compilers. Also performs an early dead code and dead data analysis in this mode. Objects with unreferenced internal linkages will be dead-stripped in the compiler rather than in the linker.
|
|
Inlining
|
Enables inline expansion. If there is a #pragmaINLINE before a function definition, all calls of this function are replaced by the code of this function, if possible.
Using the -Oi=c0 option switches off inlining. Functions marked with the #pragma INLINE are still inlined. To disable inlining, use the -Oi=OFF option.
|
|
Bottom-up Inlining
|
Check to control the bottom-up function inlining method. When active, the compiler inlines function code starting with the last function in the chain of functions calls, to the first one.
|