public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Marc Glisse <marc.glisse@inria.fr>
To: Eric Botcazou <ebotcazou@adacore.com>
Cc: gcc-patches@gcc.gnu.org
Subject: Re: [RTL] Canonicalize commutative operations more
Date: Tue, 02 Apr 2013 11:12:00 -0000	[thread overview]
Message-ID: <alpine.DEB.2.02.1304021202300.21244@stedding.saclay.inria.fr> (raw)
In-Reply-To: <1420303.Yr0JhII12W@polaris>

On Tue, 2 Apr 2013, Eric Botcazou wrote:

>> I am not sure about adding just a few rules. If I just say that lshift is
>> stronger than rshift, the relation is not an order (transitive) anymore.
>
> Why?  Can't you give them precedences in commutative_operand_precedence that
> preserve the transitivity?

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. But I understand that it has 
advantages over an arbitrary order, so if I ever feel the need again I 
will try to play with precedence values.

I might also experiment with the new transformation feature of .md files 
to write a pattern once and have it expand to 2 patterns for the 2 orders.

> The fear (at least mine) is that, by canonicalizing everything, you will 
> make changes behind the back of back-ends that could disable some of 
> their patterns silently.

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).

-- 
Marc Glisse

  reply	other threads:[~2013-04-02 10:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-19 17:14 Marc Glisse
2013-03-27 10:01 ` Eric Botcazou
2013-03-30 12:49   ` Marc Glisse
2013-04-02  9:23     ` Eric Botcazou
2013-04-02 11:12       ` Marc Glisse [this message]
2013-04-02 11:44         ` Eric Botcazou
2013-04-02 17:19           ` Jeff Law
2013-04-04 18:57       ` Mike Stump

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.DEB.2.02.1304021202300.21244@stedding.saclay.inria.fr \
    --to=marc.glisse@inria.fr \
    --cc=ebotcazou@adacore.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).