Re: Compiler Loop Unswitching
- From: "Bartc" <bc@xxxxxxxxxx>
- Date: Fri, 29 Feb 2008 16:43:54 GMT
"Walter Banks" <walter@xxxxxxxxxxxxx> wrote in message
news:47C82E25.FA5CF120@xxxxxxxxxxxxxxxx
Tim Frink wrote:
Based on our metrics the single most important loop optimization
on application code is moving the test to the bottom when the first
compare is known at compile time. It halves the pipe line flushes
and is almost trivial to implement.
Could you explain what you mean with "first compare"? Maybe you could
provide a small code example?
for (i = 0; i < j; i++)
dosomething();
would generated something like
if (i<j) goto zz
yy:
dosomething();
i++;
goto yy:
zz:
I guess you want yy: just before the if stmt? And (i>=j)?
What do you think of code like the following?
i=0;
goto ww;
yy:
dosomething()
i++;
ww:
if (i<j) goto yy;
--
Bart
.
- Follow-Ups:
- Re: Compiler Loop Unswitching
- From: Walter Banks
- Re: Compiler Loop Unswitching
- References:
- Compiler Loop Unswitching
- From: Tim Frink
- Re: Compiler Loop Unswitching
- From: Walter Banks
- Re: Compiler Loop Unswitching
- From: Tim Frink
- Re: Compiler Loop Unswitching
- From: Walter Banks
- Compiler Loop Unswitching
- Prev by Date: Re: data specs
- Next by Date: Re: data specs
- Previous by thread: Re: Compiler Loop Unswitching
- Next by thread: Re: Compiler Loop Unswitching
- Index(es):
Relevant Pages
|