Re: Loop unrolling

Clifford Click <>
22 Sep 1998 14:40:24 -0400

          From comp.compilers

Related articles
loop unrolling (1990-11-05)
Loop unrolling (Amelia De Vivo) (1998-09-18)
Re: Loop unrolling (Clifford Click) (1998-09-22)
Loop unrolling (Amelia De Vivo) (1998-09-26)
| List of all articles for this month |

From: Clifford Click <>
Newsgroups: comp.compilers
Date: 22 Sep 1998 14:40:24 -0400
Organization: Sun Microsystems
References: 98-09-077
Keywords: optimize

Amelia De Vivo wrote:
> Could someone in this newsgroup suggest me a good reading about loop
> unrolling and related register allocation problems?
> Thank in advance
> Amelia De Vivo
> [There was an exhaustive article on software pipelining in Computing
> Surveys a year or two ago. -John]

Note that loop unrolling != software pipelining.

Software pipelining pretty much requires allocation & scheduling
during the unrolling part. You get a faster schedule, less startup
time, less code. But more compile time and more engineering
complexity (ie. bugs).

In loop unrolling, you just clone the loop body a few times (well, you
also need startup/cleanup loop handling). Then the "normal" code
schedule and register allocation takes place. Much simpler to
implement; harder to screw up (you _can_ blow out I-cache, or not
unroll enough but these are straightforward problems to avoid). Code
is a little slower; you pay pipeline penalties once per trip around
the big loop. Might be a wash on compile time, depending on how fast
you can compile big loop bodies.


Cliff Click Compiler Designer and Researcher
cliffc at JavaSoft
(408) 863-3266 MS UCUP02-302

Post a followup to this message

Return to the comp.compilers page.
Search the comp.compilers archives again.