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.

How to avoid some PAINFULLY SLOW compile times

I have been doing high-performance optimization of complex algorithms for decades. I had not used CCS for more than a few years. I ALWAYS create a workstation or Windows emulation of any embedded code that I am working on, because when I start with working code, it is SOO muc faster and easier to modify and test it outside of any embedded development system that I have ever encountered. 

This evening, I was slugging away at some code and making good progress. Then I went to compile it under CCS to look at the loop pipelining reports. The compilation time under CCS had been several minutes.  (Using Version 3.3.28.2, IDE 5.95.0.219 OK: I just saw that the copyright on the compiler belonging to my employer says 2006... Hmm) But when the compiler hung for more then ten minutes, I started to believe that it was broken.  Not so much.  Several PAINFUL hours later, I discovered the problem.

I wish that I could figure out how to contact the CCS development team. But hell, it's 5:00 AM and I've had enough. Besides,. I don't know whether the problem persists in recent versions of CCS.

       I had gone from about 12 to maybe 16 local pointer variables ... THAT WAS THE WHOLE PROBLEM!  This happens at optimization level 2, but not level 1, and independent of whether loop pipelining is turned on. I'm assuming that either there is a very expensive optimization analysis, or a bug.

By declaring those local stack based pointers to be of type

unsigned short * restrict

instead of

unsigned short *

The compile time was suddenly MUCH, MUCH faster.  (Maybe half of what it was before my changes made it unbearable)

(CAREFUL THERE CHILDREN:  DON'T SAY "restrict" IF YOU DON'T MEAN IT!!)

 

  • We have fixed some compile time problems in our tools.  It is a good guess that you have an older compiler which does not have these fixes.  Please update your compiler.  Visit this wiki page for details.

    John Senko said:
    I ALWAYS create a workstation or Windows emulation of any embedded code that I am working on

    I'm pretty sure you are using a C6000 device.  If so, then you are probably interested in the host intrinsics package.  This package allows you to execute code which invokes C6000 intrinsics, like _add2, on a hosted system.

    John Senko said:
    I wish that I could figure out how to contact the CCS development team.

    You just did.

    Thanks and regards,

    -George

  • Thanks George.

    I appreciate the clue about the host intrinsics package. It will come in handy, But as things have gone so far, I am cleaning up somebody else effort, and I have not gotten around to using many different intrinsics in the code, and only needed to define macros for three trivial instrinsics. That will change eventually. In the mean time. minor things like maximizing the number of active bits in the fixed-point decisions, and dealing with memory allocation and traffic has kept me busy.

    Well, gee, then there was the fact that nobody had looked at the output of the compiler at all, and using appropriate choices of type declarations prevented a lot of unnecessary extract operations of 16 bit values from 32 bit values!

    Perhaps if I worked what my aging father considers to be "normal" or "socially acceptable" hours, I might have been able to get the info from my employer necessary to update his tools! A pop-up may have asked me to do that recently. I will update and report back as to whether that reduces or eliminates the compile time penalty that I ran into.

    John