
Optimization Types and Functions
SC100 C Compiler
5-29
5.3.4 Time Optimizations
The following three options are provided to enable you to optimize your code with the emphasis on
maximizing program execution speed:
The
-Ot
option produces code that is faster, and possibly larger, than the code output by the default
-O2
option.
The
-Ot1
option results in yet faster program execution, and a potentially larger program than the
-Ot
option.
The
-Ot2
option produces the fastest code of the three. Programs optimized using this option are
likely to occupy more memory size than those produced with either option
-Ot
or
-Ot1
.
5.3.4.1 Time optimization levels and criteria
When optimizing for speed, the compiler includes all optimizations in both the high-level and low-level
optimization phases, subject to the specific criteria for the selected option, as shown in Table 5-4.
All the optimizations included in the previous table increase the size of the code.
Further information about software pipelining is provided in
Section 5.3.3.2,
“
Low-level software
pipelining.
”
For details of the conditional execution optimization, see
Section 5.3.3.3,
“
Conditional
execution and predication.
”
Table 5-4. Time Optimization Criteria
Criteria
-Ot
-Ot1
-Ot2
Description
Small loop size.
25
25
50
Maximum size of a loop (in instructions) to which the
following optimizations are applied:
Software pipelining
Prefix grouping (See
Section 5.3.4.2,
“
Prefix
grouping.
”
)
Conditional execution
block size.
5
5
10
Maximum size of a basic block (in instructions) which is
converted to use the
ift/iff
instructions.
Loop bound type for
software pipelining.
Static
Static
Dynamic
Determines whether software pipelining is applied to
loops:
Static: Software pipelining is applied only to loops
whose bounds (upper and lower limits) are constants
or static variables known at compilation time.
Dynamic: Software pipelining is applied to loops with
bounds that are not known at compilation time.
Loop alignment.
No
No
Yes
Forces the loop start address to 16-byte alignment.
Non-short loops perform faster if aligned in this way. This
may increase the size of the code.