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.

C6000 CGT v6 produces slower code than v4



Greetings,

we are considering updating from CCS2.12.14 to CCS3.3

This includes updating from CGT v4.10 to v6.0.8
Subsequently I have also added v6.0.21 CGT

I am seeing that the new (6713) code runs 20% slower than the old code, which
is unexpected. (expected speedup!).  Until we can get at least the same speed, we can't upgrade, which is a pain because in other ways the tools have improved...

I also have a small simulator project that demonstrates similar slowdown that I can share.

Does anyone else see similar problems?  I wonder if TI has internal tests that involve profiling compiled code as part of compiler quality assurance?

  • What compiler options are you using under 6.0.21?

  • Brad Griffis said:

    What compiler options are you using under 6.0.21?

    -g -s -o3 -fr".\CCS2" -ff".\CCS2" -d"_DEBUG" -d"CHIP_6713" -mv6710

    and identical options under 4.10 and 6.0.8

    BTW I can give anyone the entire project

     

  • I attach two very simple projects that build and run in the 6713 simulator. Both of these demonstrate the problem.

    According to my colleage who made simprofile2 "code executes in 898 cycles using CCS 2.2 and 1783 cycles using CCS 3.3"

    --

    Eliot

    SimProfile.zip
  • Eliot,

    Can you please try comparing the two files using only the CCS 3.3 simulator?  Right now you have several variables here, i.e. different codegen and different CCS/simulator.  You should be able to build an out file using CCS 2.2 and then load/run in CCS 3.3.  That way you can at least compare the cycle counts within the same simulator.  I want to make sure there's not something different in the simulators themselves...

    Brad

  • Hi Brad,

    We already have been simulating only with CCS 3.3.  When I said "Using CCS2.2", I really meant "Compiled with CCS2.2".

    We got another response from within TI.  At least part of the degradation is due to the new CGT being more conservative about memory aliasing, thus we need to make use of the restrict keyword.

    I certainly see that it helps. I will rerun my tests and post the results here later.

    --

    Eliot

  • 3 independent variables:  CGT version 4.10b, 6.0.8, 6.0.21.    Build with -g or (not / for 4.10 used -gp).   Restrict qualifier.   2 projects. Ran both in CCS3 simulator/profiler.  Profile numbers are for main()

    Simprofile.pjt,   6.0.21 | -g  174K cycles,  |  (no -g, no restrict) 172K cycles | -g, restrict  142K cycles | restrict  137K cycles |

    Simprofile.pjt,   4.10b  | -g  136K cycles,  |  (-gp, no restrict) 136K cycles | -g, restrict  133K cycles | restrict  133K cycles |

    So, in this case adding the restrict qualifier with new CGT brings speed back to close, but  not quite as good as old tools.

     

    Simprofile2.pjt,   6.0.8 | -g  37500 cycles,  |  (no -g, no restrict) 36100 cycles | -g, restrict  36800 cycles | restrict  35300 cycles |

    Simprofile2.pjt,   6.0.21 | -g  40000 cycles,  |  (no -g, no restrict) 38600 cycles | -g, restrict  39200 cycles | restrict  37700 cycles |

    Simprofile2.pjt,   4.10b  | -g  41000 cycles,  |  (-gp, no restrict) 39900 cycles | -g, restrict  41000 cycles | restrict  40000 cycles |

    6.x CGT better than 4.x, but 6.0.21 produces slower code than 6.0.8?

  • Thanks a lot for sharing your results.  It's good to see that using the restrict keyword has made a big difference.

    I imagine the performance was better in 6.0.8 than 6.0.21 due to bug fixes.  That is, some optimizations may have been "tamed" so as to not generate an incorrect result.

    Brad