This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] New if-combining pass, addresses PRs 15353 and 31657
On Thu, 26 Apr 2007, H. J. Lu wrote:
> On Thu, Apr 26, 2007 at 05:47:47PM +0200, Richard Guenther wrote:
> > On Thu, 26 Apr 2007, Andrew Pinski wrote:
> >
> > > On 4/26/07, Richard Guenther <rguenther@suse.de> wrote:
> > > > On Wed, 25 Apr 2007, Andrew Pinski wrote:
> > > >
> > > > > On 4/25/07, Richard Guenther <rguenther@suse.de> wrote:
> > > > >
> > > > > > + /* returning 1 causes phiopt to trigger in */
> > > > > If this is true, then this pass should run before phiopt so you can
> > > > > catch more stuff.
> > > >
> > > > Well, I thought it is not profitable to do the transformation if phiopt
> > > > can remove the same amount of control flow. Basically replacing
> > > >
> > > > x = (a >> b)
> > > > if (x & 1)
> > > > y = (a >> c)
> > > > if (y & 1)
> > > > return 1;
> > > > else
> > > > return 0;
> > > >
> > > > with
> > > >
> > > > tmp = (1 << b) | (1 << c)
> > > > if (a & tmp == tmp)
> > > > return 1;
> > > > else
> > > > return 0;
> > > >
> > > > instead of
> > > >
> > > > x = (a >> b)
> > > > if (x & 1)
> > > > y = (a >> c)
> > > > return y & 1;
> > >
> > > Well it depends on the target :). Some (like spu-elf) non hinted
> > > branches (and mispredicted hinted branches) are really really bad so
> > > the first case of getting rid of an extra branch is a good thing.
> >
>
> Will it help
>
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=25553
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31460
No, those are unrelated.
Richard.