From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17046 invoked by alias); 21 Jan 2015 20:00:53 -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 17028 invoked by uid 89); 21 Jan 2015 20:00:52 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail3-relais-sop.national.inria.fr Received: from mail3-relais-sop.national.inria.fr (HELO mail3-relais-sop.national.inria.fr) (192.134.164.104) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Wed, 21 Jan 2015 20:00:49 +0000 Received: from stedding.saclay.inria.fr (HELO stedding) ([193.55.250.194]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/AES128-SHA; 21 Jan 2015 21:00:45 +0100 Received: from glisse (helo=localhost) by stedding with local-esmtp (Exim 4.84) (envelope-from ) id 1YE1SH-0007bl-Bt; Wed, 21 Jan 2015 21:00:45 +0100 Date: Wed, 21 Jan 2015 21:24:00 -0000 From: Marc Glisse To: gcc-patches@gcc.gnu.org cc: rv@rasmusvillemoes.dk Subject: Re: [PATCH 2/4] match.pd: Add x & ~(x & y) -> x & ~y pattern Message-ID: User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-SW-Source: 2015-01/txt/msg01942.txt.bz2 Hello, (sorry for the broken thread, for some reason I haven't received any email from gcc since about 10am, I'll investigate later) +/* x & ~(x & y) -> x & ~y */ +(simplify + (bit_and:c @0 (bit_not (bit_and:c@2 @0 @1))) + (if (TREE_CODE (@2) != SSA_NAME || has_single_use (@2)) + (bit_and @0 (bit_not @1)))) Wouldn't it make more sense to put @2 on bit_not? If bit_and is used multiple times, the transformation is neutral so it should be done as a canonicalization. On the other hand, if bit_not is used multiple times, the transformation adds an extra bit_not (which might be free when there is an andn insn). So I believe the 2 main options are: - move @2 on the bit_not - don't test has_single_use at all -- Marc Glisse