Optimization Levels
Optimization Performance
Optimization Performance
–
–
o3
o3
Removes all functions that are never called
Removes all functions that are never called
Simplifies functions with return values that are never used
Simplifies functions with return values that are never used
Inlines calls to small functions
Inlines calls to small functions
Identifies file
Identifies file
-
-
level variable characteristics
level variable characteristics
–
–
o0
o0
Performs control
Performs control
-
-
flow
flow
-
-
graph simplification
graph simplification
Allocates variables to registers
Allocates variables to registers
Performs loop rotation
Performs loop rotation
Eliminates unused code
Eliminates unused code
Simplifies expressions and statements
Simplifies expressions and statements
Expands calls to functions declared inline
Expands calls to functions declared inline
–
–
o1
o1
Performs local copy/constant propagation
Performs local copy/constant propagation
Removes unused assignments
Removes unused assignments
Eliminates local common expressions
Eliminates local common expressions
–
–
o2
o2
Default (
Default (
-
-
o)
o)
Performs loop optimizations
Performs loop optimizations
Eliminates global common sub
Eliminates global common sub
-
-
expressions
expressions
Eliminates global unused assignments
Eliminates global unused assignments
FUNCTION
FUNCTION
LOCAL
LOCAL
FILE
FILE
PROGRAM
PROGRAM
–
–
o3
o3
–
–
pm
pm
Optimizer levels zero through three, offer an increasing array of actions, as seen above. Higher
levels include all the functions of the lower ones. Increasing optimizer levels also increase the
scope of optimization, from considering the elements of single entry, single-exit functions only,
through all the elements in a file. The “-pm” option directs the optimizer to view numerous input
files as one large single file, so that optimization can be performed across the whole system.
D- 10 C28x – C Programming