Related articles |
---|
Help with research on optimization techniques abacus@acaps.CS.McGill.CA (1995-10-16) |
Re: Help with research on optimization techniques preston@tera.com (1995-10-23) |
Newsgroups: | comp.compilers |
From: | preston@tera.com (Preston Briggs) |
Keywords: | optimize |
Organization: | Compilers Central |
References: | 95-10-086 |
Date: | Mon, 23 Oct 1995 17:41:17 GMT |
abacus@acaps.CS.McGill.CA (Hisham PETRY) writes:
> I am requesting some assistance in researching my project,
>"While to For loop conversion". The motivation for this transformation
>is the fact that McGill has several optimizations for For loops that
>don't exist for While loops.
Lots of people do this, for exactly the same reason.
Not many papers about it though. One that comes to mind is
author="Randy Allen and Steve Johnson",
title="Compiling {C} for Vectorization, Parallelization, and Inline
Expansion",
pages="241--249",
journal=sigplan,
year=1988,
month=jul,
volume=23,
number=7,
note=pldi88
>proofs of loop equivalence,
>showing that in fact While loops are equivalent to For loops.
Well, it's trivial in C.
while (p) x;
is exactly equivalent to
for(; p; ) x;
Of course, this probably isn't very helpful to your compiler. I'd
think you'll want a more precise description of your target (i.e.,
just what sort of for loops are useful to the compiler). And then I
think you'll find that not every while loop can be converted into that
form.
Preston Briggs
--
Return to the
comp.compilers page.
Search the
comp.compilers archives again.