This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Fix PR37053: Move tweaks of commutative precedence to target hook
- From: Peter Bergner <bergner at vnet dot ibm dot com>
- To: Richard Sandiford <rdsandiford at googlemail dot com>
- Cc: Paolo Bonzini <paolo dot bonzini at gmail dot com>, Maxim Kuvyrkov <maxim at codesourcery dot com>, gcc-patches <gcc-patches at gcc dot gnu dot org>, Paolo Bonzini <bonzini at gnu dot org>, Ian Lance Taylor <iant at google dot com>, Luis Machado <luisgpm at linux dot ibm dot com>
- Date: Mon, 06 Jul 2009 14:09:35 -0500
- Subject: Re: [PATCH] Fix PR37053: Move tweaks of commutative precedence to target hook
- References: <4A44D817.2020107@codesourcery.com> <1246031128.5284.45.camel@otta> <4A44FA19.9030209@gmail.com> <4A44FDFA.3060403@codesourcery.com> <87eit6136s.fsf@talisman.home> <4A45FD7D.9030606@gmail.com> <1246111576.5071.1.camel@otta> <4A462DB9.4080808@gmail.com> <1246590986.5392.25.camel@otta> <4A4D9E63.1010807@gmail.com> <874otsc3r2.fsf@talisman.home>
On Sat, 2009-07-04 at 08:21 +0100, Richard Sandiford wrote:
> Paolo Bonzini <paolo.bonzini@gmail.com> writes:
> > Hmm maybe with a split?
I'll give that a test... unless you think Richard's idea below is the
way to go.
> What do you think about the idea of splitting "is this canonical?"
> from "is it normally better to swap these two, all other things being
> equal?". I.e. have two versions of swap_commutative_operands_p, such as
> must_swap_commutative_operands_p and prefer_to_swap_commutative_operands_p.
> Things like canonicalize_change_group would use the "must" version
> whereas simplification routines would generally use the "prefer" version.
I like this, because it's similar to what we have now, but how does this
solve the m68k problem? It seems that this would only work if we could
guarantee that must_swap_commutative_operands_p is called after the
prefer_to_swap_commutative_operands_p calls, otherwise, we'll end up
swapping them like we are now. And looking at canonicalize_change_group
(your one suggested call to must_swap_commutative_operands_p), it seems
to be called only from cse.c, is that really late enough to guarantee
we won't call prefer_to_swap_commutative_operands_p anymore?
Peter