From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29373 invoked by alias); 14 Jan 2015 12:45:44 -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 29344 invoked by uid 89); 14 Jan 2015 12:45:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 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, 14 Jan 2015 12:45:35 +0000 Received: from ip-149.net-81-220-91.toulouse.rev.numericable.fr (HELO laptop-mg.local) ([81.220.91.149]) by mail3-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 14 Jan 2015 13:45:31 +0100 Date: Wed, 14 Jan 2015 13:14:00 -0000 From: Marc Glisse Reply-To: gcc-patches@gcc.gnu.org To: Rasmus Villemoes cc: gcc-patches@gcc.gnu.org Subject: Re: RFC: Two minor optimization patterns In-Reply-To: <877fwquwug.fsf@rasmusvillemoes.dk> Message-ID: References: <877fwquwug.fsf@rasmusvillemoes.dk> 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/msg01045.txt.bz2 On Tue, 13 Jan 2015, Rasmus Villemoes wrote: > diff --git gcc/match.pd gcc/match.pd > index 81c4ee6..04a0bc4 100644 > --- gcc/match.pd > +++ gcc/match.pd > @@ -262,6 +262,16 @@ along with GCC; see the file COPYING3. If not see > (abs tree_expr_nonnegative_p@0) > @0) > > +/* x + (x & 1) -> (x + 1) & ~1 */ > +(simplify > + (plus @0 (bit_and @0 integer_onep@1)) > + (bit_and (plus @0 @1) (bit_not @1))) > + > +/* x | ~(x | y) -> x | ~y */ > +(simplify > + (bit_ior @0 (bit_not (bit_ior @0 @1))) > + (bit_ior @0 (bit_not @1))) You may want to consider using has_single_use (see other patterns). -- Marc Glisse