Compiler Advice (on TI Wiki)

Advice 27000: Use Optimization Options
Advice 27001: Increase Optimization Level
Advice 27002: Do not turn off software pipelining
Advice 27003: Avoid compiling with debug options
Advice 27004: No Performance Advice generated
Advice 30000: Prevent Loop Disqualification due to call
Advice 30001: Prevent Loop Disqualification due to rts-call
Advice 30002: Prevent Loop Disqualification due to asm statement
Advice 30003: Prevent Loop Disqualification due to complex condition
Advice 30004: Prevent Loop Disqualification due to switch statement
Advice 30005: Prevent Loop Disqualification due to arithmetic operation
Advice 30006: Prevent Loop Disqualification due to call(2)
Advice 30007: Prevent Loop Disqualification due to rts-call(2)
Advice 30008: Improve Loop; Qualify with restrict
Advice 30009: Improve Loop; Add MUST_ITERATE pragma
Advice 30010: Improve Loop; Add MUST_ITERATE pragma(2)
Advice 30011: Improve Loop; Add _nassert()

Typical Advice

 advice #27003: Detecting compilation with debug option -g, which hinders
optimization. To optimize, remove -g or compile with
--optimize_with_debug_option.

Why is the Compiler giving this Advice ?

The compiler detects that your compilation is being done using -g, which limits software-pipelining. Software-pipelining is a key optimization for achieving good performance. This Advice is issued to alert you to NOT use compiler option -g. -g is a good option for debugging, but it is recommended that this option not be used for production code because of the negative performance implications.


What it means

For improved performance, at optimization levels --opt_level=2 (or -O2) and -O3, the compiler attempts to software pipeline your loops. Using -g limits this software-pipelining; you may see a performance loss with this option. For best performance, use compiler options -o2 or higher; this is critical for generating efficient code sequences. In general, to achieve maximal performance, avoid using the following in production code :



The easiest way to improve performance is to invoke optimization by specifying the --opt_level=n option on the compiler command line. You can use -On to alias the --opt_level option. The n denotes the level of optimization (0, 1, 2, and 3), which controls the type and degree of optimization.


--opt_level=0 or -O0


--opt_level=1 or -O1 : Performs all --opt_level=0 (-O0) optimizations, plus:


--opt_level=2 or -O2 : Performs all --opt_level=1 (-O1) optimizations, plus:


· --opt_level=3 or -O3 : Performs all --opt_level=2 (or -O2) optimizations, plus:Italic text* Removes all functions that are never called


Note that -o defaults to -o2. In the absence of any -o options, no optimization is performed. By default, the -o switch optimizes for performance. This may increase code size. If code size is an issue, do not reduce the level of optimization. Instead, use the -ms switch to affect the optimization goal (performance versus code size).

For more information, see C6000 Compiler: Recommended Compiler Options.


Risks, Severity

Using -g results in loss of performance.


Suggested Action

Remove -g from compile options; compile with options -o2 or higher.

More Resources

Want to squeeze a few more Performance Cycles out of your application? Leverage the e2e (Engineer-to-Engineer) online community to get all of your Advice questions answered! Or, give back to the community with your expertise.

Go to the TI Compiler's e2e online forum! 

E2e.jpg For technical support please post your questions at http://e2e.ti.com.