This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: Optimising std::find on x86 and PPC
- From: Andrew Pinski <pinskia at physics dot uc dot edu>
- To: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- Cc: Zdenek Dvorak <rakdver at atrey dot karlin dot mff dot cuni dot cz>, gcc at gcc dot gnu dot org, Theodore Papadopoulo <Theodore dot Papadopoulo at sophia dot inria dot fr>, Chris Jefferson <caj at cs dot york dot ac dot uk>, Paolo Carlini <pcarlini at suse dot de>, libstdc++ <libstdc++ at gcc dot gnu dot org>
- Date: Tue, 14 Dec 2004 16:55:00 -0500
- Subject: Re: Optimising std::find on x86 and PPC
- References: <200412141909.iBEJ9XZ7027097@mururoa.inria.fr> <41BF4753.3070803@suse.de> <41BF4E0F.5020703@suse.de> <m3sm68zhga.fsf@uniton.integrable-solutions.net>
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