Quantcast
Channel: Tools
Viewing all articles
Browse latest Browse all 91752

Forum Post: How to avoid loop-pipelining of busy-waiting loops?

$
0
0

Hi,

We've several busy-waiting loops in inline-functions, mostly to make sure a  peripheral is ready before it is used again.
No matter how I annotate the loops, the compiler aggressively tries to software-pipeline those loops (which have an expected trip-count of 0) even at -o2, and because the functions are inline-functions inside an unrolled loop body this leads to serious code bloat.

One of the loops in question:

[quote]
        #pragma PROB_ITERATE(, 1)
        do {
            iprLo = edmaHandle->regs->TPCC_IPR;
        } while (!(iprLo & tccMask));
[/quote]

generated result code:
[quote]
;*         ii = 13 Schedule found with 2 iterations in parallel
[/quote]

I even tried MUST_ITERATE(1, 5) taking the risk of non-loop code generated, yet all I can get is a sploop :/

Isn't there any pragma to tell the compiler to not software pipeline a loop, no matter how well it can be optimized?

Thank you in advance, Clemens

UPDATE: Forgot to mention. This happens on C6678 with CGT-7.4.6


Viewing all articles
Browse latest Browse all 91752

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>