|Loop Optimizations and Gotos firstname.lastname@example.org (1995-11-08)|
|Re: Loop Optimizations and Gotos email@example.com (1995-11-12)|
|Loop Optimizations and Gotos firstname.lastname@example.org (Dave Lloyd) (1995-11-12)|
|Re: Loop Optimizations and Gotos email@example.com (1995-11-13)|
|Re: Loop Optimizations and Gotos firstname.lastname@example.org (1995-11-13)|
|Re: Loop Optimizations and Gotos email@example.com (1995-11-16)|
|Re: Loop Optimizations and Gotos firstname.lastname@example.org (1995-11-17)|
|Re: Loop Optimizations and Gotos email@example.com (1995-11-17)|
|Re: Loop Optimizations and Gotos firstname.lastname@example.org (1995-11-20)|
|Re: Loop Optimizations and Gotos email@example.com (Paul Long) (1995-11-21)|
|[7 later articles]|
|From:||firstname.lastname@example.org (Cliff Click)|
|Date:||Mon, 13 Nov 1995 14:00:29 GMT|
email@example.com (Jim Allard) writes:
> [will our machine generated C code run faster if we use for and while
> loops rather than equivalent if and goto loops?]
All the compilers I've worked for come in 2 flavors: C/etc & Fortran.
The C guys know that loops come in a huge variety, and will find them
no matter how loops look. They then do loop things, but standard C
pointer semantics restrict how far they can go. The Fortran guys
follow arrays, array references, and DO loops, and then they really go
to town on the loops, but they are less likely to pick up on a GOTO
loop. Very few compilers will take generic pointer loads and reverse
them into array references. Nobody can insert into C code the missing
Fortran "no aliasing" semantics.
> The compilers we care the most about are for NT. Anyone have any insights?
Write easy code; most C compilers will spot the loops and go as far as
they can. Write array references instead of pointer dereferences
where possible, because not everybody can do this. If you have large
data structures and small regular kernals, write Fortran instead of C.
Cliff Click Compiler Researcher & Designer
RISC Software, Motorola PowerPC Compilers
firstname.lastname@example.org (512) 891-7240
Return to the
Search the comp.compilers archives again.