Optimization Levels
Compiler Advanced Options
To get to these options, go to Project Build Options in Code Composer Studio.
In the category, pick Advanced.
The first thing to notice under advanced options is the Auto Inlining Threshold.
- Used with –o3 option
- Functions > size are not auto inlined
Note
: To prevent code size increases when using –o3, disable auto inlining with -oi0
The next point we will cover is the Normal Optimization with Debug (-mn).
- Re-enables optimizations disabled by “–g” option (symbolic debug)
- Used for maximum optimization
Note
: Some symbolic debug labels will be lost when –mn option is used.
Optimizer should be invoked incrementally:
-g test
Symbols kept for debug
-g -o3 test
Add optimizer, keep symbols
-g -o3 -mn test
More optimize, some symbols
-o3 test
Final rev: Full optimize, no symbols
[-mf] : Optimize for speed instead of the default optimization for code size
[-mi] : Avoid RPT instruction. Prevent compiler from generating RPT instruction. RPT instruc-
tion is not interruptible
[-mt] : Unified memory model. Use this switch with the unified memory map of the 2810 &
2812. Allows compiler to generate the following:
-RPT PREAD for memory copy routines or structure assignments
-MAC instructions
-Improves efficiency of switch tables
D- 12 C28x – C Programming