Related articles |
---|
Loop Unroll lxh@arch.cs.pku.edu.cn (Alkaid) (2001-05-18) |
Re: Loop Unroll mike@dimmick.demon.co.uk (Mike Dimmick) (2001-05-21) |
Re: Loop Unroll gvmt@bgl.vsnl.net.in (Venkatesha Murthy G.) (2001-05-21) |
Re: Loop Unroll samiam@cisco.com (Scott Moore) (2001-05-21) |
Re: Loop Unroll rkrayhawk@aol.com (2001-05-21) |
Re: Loop Unroll christian.bau@isltd.insignia.com (Christian Bau) (2001-05-22) |
From: | "Venkatesha Murthy G." <gvmt@bgl.vsnl.net.in> |
Newsgroups: | comp.compilers |
Date: | 21 May 2001 02:05:07 -0400 |
Organization: | Compilers Central |
Keywords: | optimize |
Posted-Date: | 21 May 2001 02:05:06 EDT |
"Alkaid" <lxh@arch.cs.pku.edu.cn> asked:
> When we do ILP optimization, loop unrolling is a kind of method.
> But there is a question: if loop time is a big prime number, how to unroll
> the loop?
> e.g. when loop time is 100, I can unroll the loop 4 times to get a new one
> which has 25 iterations. What shall I do if the loop time is 101?
Well, you could try replicating the loop body once outside the loop
and then unroll the loop which now runs an even number of times. You'll
of course have to setup initial conditions for the "outside" block(s).
Or you could find a number n such that the loop count = 2^n + r, r > 0
and r is something manageable and then you could make two loops - one
runnning r times, and one 2^n times - with the same body (and appropriate
initial conditions).
Venkatesh
-
Venkatesha Murthy G.
Return to the
comp.compilers page.
Search the
comp.compilers archives again.