Use this panel to control compiler optimizations. The compiler's optimizer can apply any of its optimizations in either global or non-global optimization mode. You can apply global optimization at the end of the development cycle, after compiling and optimizing all source files individually or in groups.
The following figure shows the
Optimization
panel.
Figure 1.
Tool settings - ARM Compiler > Optimization

The following table lists and defines each option of the
Optimization
panel.
Table 1.
Tool settings -
ARM Compiler > Optimization Options
| Option
|
Description
|
|
Optimization Level
|
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
- The compiler performs all the level 3 optimizations. This setting is equivalent to specifying the -O4 command-line option. At this optimization level, the compiler adds repeated subexpression elimination and loop-invariant code motion
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.
|
|
Interprocedural Analysis
|
Controls whether the compiler views single or multiple source files compile time.
- Off
- Compiler compiles one file at a time, functions are seen in the order as they appear in the source file. An object file is created for each source.
- File
- The compiler sees all functions and data in a translation unit (source file) before code or data is generated. This allows inlining of functions that may not have been possible in -ipa off mode.
- Program
- The compiler sees all the source files of a project before code and data are generated. This allows cross-module optimizations, including inlining.
- Program-Final
- Similar to Program but object files are passed explicitly to the linker.
|
|
Inlining
|
Enables inline expansion.
- Smart
- Inlines function declared with the inline qualifier
- Auto Inline
- Inlines small function even if they are not declared with the inline qualifier
- Off
- No functions are inlined
|
|
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.
|
Note:
For more information on interprocedural analysis optimizations, refer to the section
Command-Line Options for Optimization
(
-O).