|Unrolling and spilling linuxkaffee_@_gmx.net (Stephan Ceram) (2009-01-28)|
|Re: Unrolling and spilling SidTouati@inria.fr (Sid Touati) (2009-01-29)|
|Re: Unrolling and spilling email@example.com (Harold Aptroot) (2009-01-29)|
|Re: Unrolling and spilling firstname.lastname@example.org (cr88192) (2009-01-30)|
|Re: Unrolling and spilling email@example.com (Carlie Coats) (2009-05-23)|
|From:||Sid Touati <SidTouati@inria.fr>|
|Date:||Thu, 29 Jan 2009 13:21:50 +0100|
|Posted-Date:||29 Jan 2009 19:47:45 EST|
Stephan Ceram a icrit :
> In many compiler books and papers you read that loop unrolling
> possibly increases register pressure that leads to extra spill code. I
> don't see the reason how this can happen. When you perform unrolling
> at assembly level, the loop bodies are just replicated, so the
> register life ranges are not really increased. Also, when unrolling is
> done at the source code, I don't really see a reason why the register
> allocation should add more spill instructions. More spilling would
> mean that you have a change in the life ranges of the variables that
> adversely influenced the interference graph. But why should I get
> more conflicting life ranges after unrolling?
> The only reason I see are instruction scheduling techniques that might
> mix up life ranges but the literature does not mention these
> optimizations in context of spilling and unrolling.
Your are right, there is no reason that loop unrolling increases the
register pressure if no instruction scheduling is applied afterwards.
The register pressure may increase after loop unrolling if instruction
scheduling is applied afterwards. If the instruction scheduler is
aggressive, then the register pressure (MAXLIVE) may increase, because
more instructions are scheduled, so more lifetime intervals may be in
conflict. If no care is taken, additional spill code may be introduced.
Bounding and/or analysing register pressure before instruction
scheduling is done using the register saturation concept. The following
article studies the relationship between loop unrolling and register
Sid-Ahmed-Ali Touati. Register Saturation in Instruction Level
Parallelism. International Journal of Parallel Programming,
Springer-Verlag, Volume 33, Issue 4, August 2005. 57 pages.
Return to the
Search the comp.compilers archives again.