From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22108 invoked by alias); 2 Apr 2013 10:27:08 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 21632 invoked by uid 89); 2 Apr 2013 10:27:00 -0000 X-Spam-SWARE-Status: No, score=-9.0 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD autolearn=ham version=3.3.1 Received: from mail3-relais-sop.national.inria.fr (HELO mail3-relais-sop.national.inria.fr) (192.134.164.104) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 02 Apr 2013 10:26:57 +0000 Received: from stedding.saclay.inria.fr ([193.55.250.194]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 02 Apr 2013 12:26:55 +0200 Received: from glisse (helo=localhost) by stedding.saclay.inria.fr with local-esmtp (Exim 4.80) (envelope-from ) id 1UMyQZ-0005gi-3w; Tue, 02 Apr 2013 12:26:55 +0200 Date: Tue, 02 Apr 2013 11:12:00 -0000 From: Marc Glisse To: Eric Botcazou cc: gcc-patches@gcc.gnu.org Subject: Re: [RTL] Canonicalize commutative operations more In-Reply-To: <1420303.Yr0JhII12W@polaris> Message-ID: References: <2628063.UuGJrOXufS@polaris> <1420303.Yr0JhII12W@polaris> User-Agent: Alpine 2.02 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-SW-Source: 2013-04/txt/msg00077.txt.bz2 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