|Loop Optimizations and Gotos email@example.com (1995-11-08)|
|Re: Loop Optimizations and Gotos firstname.lastname@example.org (1995-11-12)|
|Loop Optimizations and Gotos email@example.com (Dave Lloyd) (1995-11-12)|
|Re: Loop Optimizations and Gotos firstname.lastname@example.org (1995-11-13)|
|Re: Loop Optimizations and Gotos email@example.com (1995-11-13)|
|Re: Loop Optimizations and Gotos firstname.lastname@example.org (1995-11-16)|
|Re: Loop Optimizations and Gotos email@example.com (1995-11-17)|
|Re: Loop Optimizations and Gotos firstname.lastname@example.org (1995-11-17)|
|Re: Loop Optimizations and Gotos email@example.com (1995-11-20)|
|Re: Loop Optimizations and Gotos firstname.lastname@example.org (Paul Long) (1995-11-21)|
|Re: Loop Optimizations and Gotos email@example.com (1995-11-21)|
|[6 later articles]|
|From:||firstname.lastname@example.org (Christopher Glaeser)|
|Date:||Mon, 13 Nov 1995 18:53:55 GMT|
Jim Allard <email@example.com> writes:
> With some work we can identify these
> loops by a pattern matching scheme that will get most of the commonly
> used loop idioms and then translate those as FOR or WHILE loops.
> We've had a debate here about whether this work is worth it.
It really depends on the compiler and the structure of the loops.
For example, are the trip counts compile-time constants or run-time
expressions? Are the loop increments 1? Are the increments a constant?
Are the increments positive? Is there control flow inside the loop such
as an IF, early loop termination, or more complex control flow? What is the
type and storage class of the loop control variable? Are there any
aliasing issues, such as a pointer could point to and modify the loop
Depending on the compiler, all these and other factors will likely affect
the efficiency of the generated code.
Before you implement this goto-to-loop translator, you should probably
compile a few sample loops (that have similar structure to the output
of your translator on your application) to make sure you get the
optimizations you want.
Christopher Glaeser firstname.lastname@example.org
Return to the
Search the comp.compilers archives again.