This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PING][PATCH][REVISED] Fix PR middle-end/PR28690, modify swap_commutative_operands_p
- From: "H.J. Lu" <hjl at lucon dot org>
- To: Peter Bergner <bergner at vnet dot ibm dot com>
- Cc: bonzini at gnu dot org, Jakub Jelinek <jakub at redhat dot com>, Pat Haugen <pthaugen at us dot ibm dot com>, Dave Korn <dave dot korn at artimi dot com>, gcc-patches at gcc dot gnu dot org, Ian Lance Taylor <iant at google dot com>, Rask Ingemann Lambertsen <rask at sygehus dot dk>, Richard Guenther <richard dot guenther at gmail dot com>, michael dot meissner at amd dot com
- Date: Sat, 14 Jul 2007 09:56:18 -0700
- Subject: Re: [PING][PATCH][REVISED] Fix PR middle-end/PR28690, modify swap_commutative_operands_p
- References: <20070713195833.GN2063@devserv.devel.redhat.com> <20070713201841.GA379@lucon.org> <1184360613.8319.104.camel@otta> <20070713214537.GA790@lucon.org> <1184385600.8319.168.camel@otta> <20070714042014.GA2405@lucon.org> <46987A58.9000009@lu.unisi.ch> <20070714142529.GA7558@lucon.org> <1184427514.8319.188.camel@otta> <20070714164844.GA8173@lucon.org>
On Sat, Jul 14, 2007 at 09:48:44AM -0700, H.J. Lu wrote:
> On Sat, Jul 14, 2007 at 10:38:34AM -0500, Peter Bergner wrote:
> > On Sat, 2007-07-14 at 07:25 -0700, H.J. Lu wrote:
> > > Peter, will gcc-PR28690-5.patch solve your problem?
> >
> > I'm not sure you actually looked at my previous post or the patch.
> > By leaving out the changes that adjust all of the precedence values
> > by -3 but leaving in this part:
> >
> > - return -1;
> > + if (REG_P (op))
> > + return (REG_POINTER (op)) ? -1 : -3;
> > + else
> > + return (MEM_P (op) && MEM_POINTER (op)) ? -2 : -4;
> >
> > You have now just changed the precedence sorting in an unwanted way.
> > For example, RTX_EXTRA which has a precedence of -2 (-5 with my patch)
> > and previously always had a lower precedence than all RTX_OBJs, now has
> > the same precedence or higher precedence than REG's and MEM's.
> > We don't want that!
> >
> > As I mentioned in the previous post, the adjustment of the precedence
> > values by -3 is totally cosmetic and will not change the behavior of
> > the compiler in any way, so I'm curious why you even attempted to leave
> > that part out.
> >
> > Peter
> >
>
> Something like this? I have a question on this part
>
>
> + if (REG_P (op))
> + return (REG_POINTER (op)) ? -1 : -3;
> + else
> + return (MEM_P (op) && MEM_POINTER (op)) ? -2 : -4;
>
>
> So the order Power 6 prefers is
>
> 1. REG_POINTER
> 2. MEM_POINTER
> 3. REG_P
> 4. MEM_P
>
> Is that correct? Will
>
> 1. REG_POINTER
> 2. MEM_POINTER
> 3. REG_P/MEM_P
>
> work for you.
>
Also will
1. REG_POINTER/MEM_POINTER
2. REG_P/MEM_P
work for you.
H.J.
- References:
- Re: [PING][PATCH][REVISED] Fix PR middle-end/PR28690, modify swap_commutative_operands_p
- Re: [PING][PATCH][REVISED] Fix PR middle-end/PR28690, modify swap_commutative_operands_p
- Re: [PING][PATCH][REVISED] Fix PR middle-end/PR28690, modify swap_commutative_operands_p
- Re: [PING][PATCH][REVISED] Fix PR middle-end/PR28690, modify swap_commutative_operands_p
- Re: [PING][PATCH][REVISED] Fix PR middle-end/PR28690, modify swap_commutative_operands_p
- Re: [PING][PATCH][REVISED] Fix PR middle-end/PR28690, modify swap_commutative_operands_p
- Re: [PING][PATCH][REVISED] Fix PR middle-end/PR28690, modify swap_commutative_operands_p
- Re: [PING][PATCH][REVISED] Fix PR middle-end/PR28690, modify swap_commutative_operands_p
- Re: [PING][PATCH][REVISED] Fix PR middle-end/PR28690, modify swap_commutative_operands_p
- Re: [PING][PATCH][REVISED] Fix PR middle-end/PR28690, modify swap_commutative_operands_p