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.

Collapse prologs and epilogs in software pipelining



Hi,

     When a loop is software pipelined, a prolog and epilog are generally required. In the manual of
TMS320C6000 Optimizing Compiler User's Guide, I learn that the compiler can collapse prologs
and epilogs. I don't understand what it means.

Thanks
Jogging

  • Say your loop can have 3 stages executing in parallel, A B C. 

    A              <-- pipeline filling up, epilog

    B A

    C B A      <-- pipeline full

    ...........

        C B   <-- pipeline 'emptying', prolog

            A

     

    The compiler could just do 2 partial pipeline executions for both epilog & prolog, or it could do some more complicated code to try to fill/empty the pipeline in fewer cycles.  That is 'collapsing', you generally trade code size for speed.

  • Thanks,

              Do you mean the compiler complete the function of prolog and epilog using another sequnce of instructions, not part of the loop body?

    I have read the generated .asm file, it seems the compiler implete prolog and epilog in another way.

     

    Jogging

  • I looked through one of my modules, and it seems the compiler rarely does much collapsing.  I get mostly 1 or 2 stages of epilogue collapsed and didn't see any prolog collapses.  I think that it does collapsing when it improves performance and avoids it otherwise.  Did you have a specific question about it?  If you are looking at the generated assembly file, you can see that it adds comments that separate the prolog, kernel, and epilog.