|Spill code and unrolling email@example.com (Stephan Ceram) (2008-12-11)|
|Re: Spill code and unrolling SidTouati@inria.fr (Sid Touati) (2008-12-12)|
|Re: Spill code and unrolling firstname.lastname@example.org (Giridhar S) (2008-12-13)|
|Re: Spill code and unrolling email@example.com (Walter Banks) (2008-12-15)|
|From:||Walter Banks <firstname.lastname@example.org>|
|Date:||Mon, 15 Dec 2008 10:03:36 -0500|
|Posted-Date:||15 Dec 2008 12:44:39 EST|
Stephan Ceram wrote:
> I've a question about loop unrolling. Let's assume that you compile
> your program without loop unrolling in advance to check if the loops
> which are candidates for loop unrolling contain any spill code. If so,
> it is very likely that after loop unrolling the contained spill code
> is duplicated by the number of how often this loop is unrolled.
> Now, I was wondering if it would be a good heuristic for a loop
> unroller to skip loops containing spill code. What do you think? Is it
> still useful to unroll such loops (since the positive effects of
> unrolling will overbalance) or will the additional spill code probably
> decrease the total program execution time (or just negligibly improve
> it), thus unrolling of these loops should be omitted?
There is one question that hasn't been a part of the mix about loop
unrolling. Loop unrolling that trades code size for execution speed
needs to consider the programmer's intent. (There are cases where the
optimization is a clear win)
In the embedded systems compilers we develop we stopped doing any loop
rolling and unrolling because most of the developers using our
compilers will naturally unroll loops when execution time is important
and roll up loops when it is not.
This is an optimization that seems to benefit most from badly written
code for our customers.
All the best of the season
Byte Craft Limited
[Where's the FREQUENCY statement when you need it? -John]
Return to the
Search the comp.compilers archives again.