www.ti.com
2.10.1 Inlining Intrinsic Operators ..................................................................................... 51
2.10.2 Automatic Inlining ................................................................................................ 51
2.10.3 Unguarded Definition-Controlled Inlining ..................................................................... 51
2.10.4 Guarded Inlining and the _INLINE Preprocessor Symbol .................................................. 51
2.10.5 Inlining Restrictions ............................................................................................. 53
2.11 Interrupt Flexibility Options (--interrupt_threshold Option) ........................................................... 54
2.12 Linking C6400 Code with C6200/C6700/Older C6400 Object Code ............................................... 55
2.13 Using Interlist ............................................................................................................... 55
2.14 Generating and Using Performance Advice ........................................................................... 56
2.15 Controlling Application Binary Interface ................................................................................ 57
2.16 Enabling Entry Hook and Exit Hook Functions ........................................................................ 58
3 Optimizing Your Code ........................................................................................................ 59
3.1 Invoking Optimization ..................................................................................................... 60
3.2 Optimizing Software Pipelining .......................................................................................... 61
3.2.1 Turn Off Software Pipelining (--disable_software_pipelining Option) ...................................... 62
3.2.2 Software Pipelining Information ................................................................................. 62
3.2.3 Collapsing Prologs and Epilogs for Improved Performance and Code Size .............................. 67
3.3 Redundant Loops .......................................................................................................... 68
3.4 Utilizing the Loop Buffer Using SPLOOP on C6400+, C6740, and C6600 ........................................ 69
3.5 Reducing Code Size (--opt_for_space (or -ms) Option) .............................................................. 70
3.6 Performing File-Level Optimization (--opt_level=3 option) ........................................................... 70
3.6.1 Controlling File-Level Optimization (--std_lib_func_def Options) ........................................... 70
3.6.2 Creating an Optimization Information File (--gen_opt_info Option) ........................................ 71
3.7 Performing Program-Level Optimization (--program_level_compile and --opt_level=3 options) ................ 71
3.7.1 Controlling Program-Level Optimization (--call_assumptions Option) ..................................... 72
3.7.2 Optimization Considerations When Mixing C/C++ and Assembly ......................................... 72
3.8 Using Feedback Directed Optimization ................................................................................. 74
3.8.1 Feedback Directed Optimization ............................................................................... 74
3.8.2 Profile Data Decoder ............................................................................................. 76
3.8.3 Feedback Directed Optimization API .......................................................................... 77
3.8.4 Feedback Directed Optimization Summary ................................................................... 77
3.9 Using Profile Information to Get Better Program Cache Layout and Analyze Code Coverage ................. 78
3.9.1 Background and Motivation ..................................................................................... 78
3.9.2 Code Coverage ................................................................................................... 79
3.9.3 What Performance Improvements Can You Expect to See? ............................................... 80
3.9.4 Program Cache Layout Related Features and Capabilities ................................................ 80
3.9.5 Program Instruction Cache Layout Development Flow ...................................................... 81
3.9.6 Comma-Separated Values (CSV) Files with Weighted Call Graph (WCG) Information ................ 84
3.9.7 Linker Command File Operator - unordered() ................................................................ 84
3.9.8 Things to be Aware of ........................................................................................... 87
3.10 Indicating Whether Certain Aliasing Techniques Are Used .......................................................... 88
3.10.1 Use the --aliased_variables Option When Certain Aliases are Used ..................................... 88
3.10.2 Use the --no_bad_aliases Option to Indicate That These Techniques Are Not Used .................. 88
3.10.3 Using the --no_bad_aliases Option With the Assembly Optimizer ........................................ 89
3.11 Prevent Reordering of Associative Floating-Point Operations ....................................................... 89
3.12 Use Caution With asm Statements in Optimized Code .............................................................. 90
3.13 Automatic Inline Expansion (--auto_inline Option) .................................................................... 90
3.14 Using Performance Advice to Optimize Your Code ................................................................... 91
3.14.1 Advice #27000 ................................................................................................... 92
3.14.2 Advice #27001: Increase Optimization Level ................................................................ 92
3.14.3 Advice #27002: Do not turn off software pipelining ......................................................... 93
3.14.4 Advice #27003: Avoid compiling with debug options ....................................................... 93
3.14.5 Advice #27004: No Performance Advice generated ........................................................ 93
3
SPRU187V–March 2014 Contents
Submit Documentation Feedback
Copyright © 2014, Texas Instruments Incorporated