This is the mail archive of the gcc-patches@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: [PATCH] New if-combining pass, addresses PRs 15353 and 31657


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.

Thanks,
Andrew Pinski


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