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.

Suggestions for Optimising Code



Hi,

I am having to optimise my C only (i.e. not C++) code aggressively for speed performance on the TMS570 (compiler version 4.7.0B2). As well as code construction optimisations I am looking at compiler build options. I have selected:

Optimisation level (--opt_level) 3
Optimise for speed (--opt_for_speed) 5

I am trying to get program mode compilation (--program_level_compile with --call_assumptions=3) working.

I also recognise that suppression of all symbolic debug information (--symdebug:none) will have a benefit, as will removing the C source interlist option (--c_src_interlist).

Does anybody have any other recommendations or techniques they can suggest to help improve my speed performance.

Regards, Tony.

  • You're well on your way.  Another view on how to use --program_level_compile is in this wiki article.

    Also considering using the option to automatically inline small functions --auto_inline=size .  It is discussed in the TMS470 Compiler User's Guide.  Search for auto_inline.

    Thanks and regards,

    -George

  • Hi George,

    Thanks for the info. I understand that auto inline is applied 'aggressively' already with --opt_level=3, not just for small functions so I haven't applied the --auto-inline explicitly.

    Your link to the TMS470 Compiler User's Guide was very helpful, I've been using a V4.6 user guide but V4.7 compiler and hadn't realised that this new version had become available in November. Very interestingly, there is a new optimisation level, --opt_level=4 which causes link time optimisation, this is a better alternative to compile level optimisation which I had trying been trying to use. --opt_level=4 does not seem to be supported by CCS4 or CCS5 which only allows levels 0-3 to be configured via the GUI, so I have had to add it manually to my compiler options command file.

    I won't mark this post as answered yet to see if anybody else has any bright ideas.

    Regards, Tony.

  • George,

    is there anyway to use the option --opt_level=4 from CCS4?


    I installed the latest version of the compiler and tried to use this level from the C/C++ Build Setup Menu and was only able to use level 0 -3.

    Thanks for your help!

    Best Regards,

    Christoph

  • Christoph,

    At the moment, this option is not visible from the GUI. You could either add it to an options file as mentioned by Tony in the earlier post or add it to the CCS build command line pattern directly after ${flags} (under Project Build Properties->C/C++ Build->TMS470 Compiler->Command line pattern).

    Edit: I take that back. I selected TMS470 CGT 4.7.0B2 in CCSv4.2.1 and was then able to see opt level 4 in the drop-down list under Basic Options.