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] Fix PR37053: Move tweaks of commutative precedence to target hook


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




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