SPRUI04G June 2015 – August 2025
In some cases, the compiler can perform better optimization if the code aids the compiler by providing additional information in the code. In such cases, the compiler can prompt you to take certain actions to improve performance, by emitting "advice".
This performance advice is of the following types:
By default, no performance advice is emitted. To control performance advice generation, use the following options:
| --advice:performance | Instruct the compiler to emit advice, which is emitted to stdout by default if enabled. Off by default. | |
| --advice:performance_file | Instruct the compiler to send any advice emitted to a file. | |
| --advice:performance_dir | Instruct the compiler to send any advice emitted to a file in a specific directory. |
Example 1: The following example sends output advice sent to stdout:
cl6x -mv6400+ -o2 -k --advice:performance func.c
"func.c", line 10: advice #30006: Loop at line 8 cannot be scheduled efficiently
as it contains a function call ("_init"). Try making "_init" an inline
function.
"func.c", line 12: advice #30000: Loop at line 8 cannot be scheduled efficiently
as it contains a function call ("_calculate"). Try to inline call or
consider rewriting loop.
Note that advice to prevent Software Pipeline Disqualification (such as that presented above) will also be printed in the .asm file. So, func.asm will contain :
;*----------------------------------------------------------------------------*
;* SOFTWARE PIPELINE INFORMATION
;* Disqualified loop: Loop contains a call
;* Loop at line 8 cannot be scheduled efficiently as it contains a
;* function call ("_init"). Try making "_init" an inline function.
;* Disqualified loop: Loop contains non-pipelinable instructions
;* Disqualified loop: Loop contains a call
;* Loop at line 8 cannot be scheduled efficiently as it contains a
;* function call ("_calculate"). Try to inline call or consider
;* rewriting loop.
;* Disqualified loop: Loop contains non-pipelinable instructions
;*----------------------------------------------------------------------------*
Example
2: The following example sends output advice to a file named
filename.advice:
cl6x -mv6400+ --advice:performance --advice:performance_file=filename.advice func.c
;******************************************************************************
;* TMS320C6x C/C++ Codegen Unix v7.5.0P12047 (a0322878 - Feb 16 2012) *
;* Date/Time created: Thu Feb 16 10:26:02 2012 *
;* *
;* Warning: This file is auto generated by the compiler and can be *
;* overwritten during the next compile. *
;* *
;******************************************************************************
;* User Options: --silicon_version=6400+
"func.c": advice #27000: Detecting compilation without optimization. Use
optimization option -o2 or higher.
Example 3: The following
examples send output advice to a file named myfile.adv in the
mydir directory using various options.
Using the --advice:performance_file and --advice:performance_dir options:
cl6x -mv6400+ -o2 -k --advice:performance_file=myfile.adv --advice:performance_dir=mydir basicloop.c
Using only the
--advice:performance_file option to specify the full path name:
cl6x -mv6400+ -o2 -k --advice:performance_file=mydir/myfile.adv basicloop.c
If --advice_dir option and full pathname are specified together, the --advice:performance_dir option is ignored, and the advice is generated in the full pathname advice file. Also, note that directory "mydir" must already exist for an advice file to be created there.
The subsections that follow describe the supported advice diagnostics.