This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: GCC Benchmarks (coybench), AMD64 and i686, 14 August 2004


Scott Robert Ladd wrote:

> Marcel Cox wrote:
> > While both these types of optimizations would be nice to have, I
> > still consider them to be optimizations that someone who writes a
> > program that does mathematical calculations should have done
> > himself when writing the program.
> 
> Almost any code can be hand-optimized for better performance; the
> SPEC2000 benchmarks, for example, are far from perfectly realized.
> And sometimes an excellent optimizer allows code to be written for
> greater clarity as opposed to cleverness. Not all loop invariants are
> so obvious.

Yes, I should really have distinguished between the 2 optimizations.
The first optimization, optimizing the body of the dv function was an
easy and obvious optimization for humans which in addition makes the
function much cleaner and more readable.
The second optimization, moving the function call out of the loop is
less obvious to humans, does not improve the readability, but should
OTOH be an optimization that a good compiler should have been able to
figure out itself.

-- 
Marcel (using XanaNews 1.16.3.1)
I can resist everything but temptation


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]