Optimising std::find on x86 and PPC

Andrew Pinski pinskia@physics.uc.edu
Tue Dec 14 21:55:00 GMT 2004


On Dec 14, 2004, at 4:40 PM, Gabriel Dos Reis wrote:

> Paolo Carlini <pcarlini@suse.de> writes:
> That is a clear regression.
>
> Tree-ssa has been sold on the name of bringing better methodology to
> optimizations; given Theo's analysis, I think this issue no longer
> belongs to V3.  It should be brought to GCC main list

Actually if we look at this way, this looks like the new unroller which
was introduced in 3.4.0 which is broken and not anything related to the
tree-ssa.  Sorry to mention that but I just don't want to give tree-ssa
a bad name since it is not related to it.

The example given in the libstdc++ archives could be summarized by:
int check(int a,int b, char *c)
{
for(;a<b;a+=4)
   if(c[a]==1) return a;
return a;
}

note how I made both a and b integers and how I increment by 4 instead 
of 1.
The thing which is confusing the loop unroller is the increment by 4 and
nothing else.

This should also effect 3.4.0 as that is when the new unroller came in.

Thanks,
Andrew Pinski



More information about the Gcc mailing list