Optimization -- praise, problem, & question

Jim Wilson wilson@tuliptree.org
Tue Jun 10 17:45:00 GMT 2003


Elijah P Newren wrote:
> As you'll notice, on the 600 Mhz Pentium III using arithmetic test #0,
> the code took longer when compiled with gcc-3.3 than it did with
> gcc-3.2.

You could submit a bug report for this performance regression.  See 
<http://gcc.gnu.org/bugs.html>.

> Finally, I was wondering if future versions of gcc (hopefully planned
> for release in the next year or so) might incorporate optimizations
> which would allow the arithmetic and array test #0's to be as fast as
> the other methods.

It wasn't obvious from your message, but I see that you are using C++ 
for this test.  You are using class fields as iteration variables for a 
loop.  Optimizing this requires being able to notice that we can load 
the field into a register before the loop, operate on the register 
within the loop, and then write it back to the class after the loop. 
This requires good alias analysis.  This will be difficult to do in the 
current gcc infrastruction, but there is a new infrastructure, tree-ssa, 
being worked on where this is more practical.  We need to get the new 
infrastructure in, and then someone needs to write an optimization pass 
to do this.  I don't know if anyone is working on this kind of 
optimization pass yet.  The infrastructure is a year or more away from 
being deployed, so it will be a while still before we can have 
optimizations like this.

> that I learned this weekend that the code it produces on the AMD
> processor is somewhat shoddy and suspect--especially at the optimization

Not surprising.  The Intel compiler exists to help sell Intel 
processors.  They don't care about how it performs for AMD processors.

Jim



More information about the Gcc mailing list