This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Compiler/AM5726: Recommended setting fro C++ Projects using TI C6000 Compiler v8.2.2

Part Number: AM5726

Tool/software: TI C/C++ Compiler

Compiler champs,

We are working with a critical customer in Israel who  is planning to use mix of C and C++ code in their critical real time control application where the C++ code leverages features like templates and overridden functions.  Using Compiler optimization, we have obtained about 50% improvement from their original code by placing the code in L2, enabling L1 cache along with -03 options.  

 Are there any additional recommended settings for C++ code that you want us to look at that can help optimize the code further. We are currently using following Language settings:

Regards,

Rahul

  • I think you already doing everything you can.  This ...

    Rahul Prabhu said:
    the C++ code leverages features like templates

    ... often creates lots of calls to small functions.  That's why enabling optimization like this ...

    Rahul Prabhu said:
    along with -03 options

    ... is important.  It causes most of those functions to be inlined.  This avoids the overhead of calling those functions, and allows the inlined code to be further optimized in context with the surrounding code.

    Thanks and regards,

    -George

  • As George said, you're probably already most of the way there by using -o3. For possibly some small additional improvement, you may want to try using the -oi/--auto_inline option and varying the number (using a high value like 10000, say --auto_inline=10000). This option controls how much inlining is performed. Be aware that the use of this option can increase compile time and code size. More details about -oi can be found in the C6000 C/C++ Optimizing Compiler User's Guide.

    -Todd