This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [RTL] Canonicalize commutative operations more
- From: Eric Botcazou <ebotcazou at adacore dot com>
- To: Marc Glisse <marc dot glisse at inria dot fr>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Tue, 02 Apr 2013 12:54:36 +0200
- Subject: Re: [RTL] Canonicalize commutative operations more
- References: <alpine dot DEB dot 2 dot 02 dot 1303191715280 dot 4515 at stedding dot saclay dot inria dot fr> <1420303 dot Yr0JhII12W at polaris> <alpine dot DEB dot 2 dot 02 dot 1304021202300 dot 21244 at stedding dot saclay dot inria dot fr>
> I can, but then I am giving lshift higher priority than every other
> operation, not just rshift. And if I want to give (vec_select x 0) a
> higher precedence than (vec_select x 1) but lower than (vec_select
> (vec_concat a b) 1), the weights may become complicated, whereas the
> comparison function could just recurse.
You cannot have both transitivity and fast-tracks in the comparison function.
However it isn't clear (at least to me) if transitivity is really required.
(vec_select x 0) and (vec_select x 1) are the same pattern so they shouldn't
be distinguished here.
> I wonder if those issues might in most cases be bugs in the back-ends
> (optimizations missed depending on the order), that the canonicalization
> would make more noticable (and thus easier to fix).
There are certainly such issues in the back-ends (and even ??? comments about
it) so sensible canonicalization is desirable.
--
Eric Botcazou