From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 47343 invoked by alias); 27 Jun 2015 12:55:57 -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 47326 invoked by uid 89); 27 Jun 2015 12:55:56 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.8 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mail2-relais-roc.national.inria.fr Received: from mail2-relais-roc.national.inria.fr (HELO mail2-relais-roc.national.inria.fr) (192.134.164.83) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Sat, 27 Jun 2015 12:55:55 +0000 Received: from ip-0.net-81-220-131.standre.rev.numericable.fr (HELO laptop-mg.local) ([81.220.131.0]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-SHA; 27 Jun 2015 14:55:52 +0200 Date: Sat, 27 Jun 2015 13:36:00 -0000 From: Marc Glisse Reply-To: gcc-patches@gcc.gnu.org To: Richard Biener cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH][5/n] Remove GENERIC stmt combining from SCCVN In-Reply-To: Message-ID: References: User-Agent: Alpine 2.20 (DEB 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed X-SW-Source: 2015-06/txt/msg02013.txt.bz2 On Fri, 26 Jun 2015, Richard Biener wrote: > + /* Equality compare simplifications from fold_binary */ > + (for cmp (eq ne) > + > + /* If we have (A | C) == D where C & ~D != 0, convert this into 0. > + Similarly for NE_EXPR. */ > + (simplify > + (cmp (convert?@3 (bit_ior @0 INTEGER_CST@1)) INTEGER_CST@2) > + (if (tree_nop_conversion_p (TREE_TYPE (@3), TREE_TYPE (@0)) > + && wi::bit_and_not (@1, @2) != 0) > + { constant_boolean_node (cmp == NE_EXPR, type); })) > + > + /* (X ^ Y) == 0 becomes X == Y, and (X ^ Y) != 0 becomes X != Y. */ > + (simplify > + (cmp (bit_xor @0 @1) integer_zerop) > + (cmp @0 @1)) > + > + /* (X ^ Y) == Y becomes X == 0. > + Likewise (X ^ Y) == X becomes Y == 0. */ > + (simplify > + (cmp (bit_xor:c @0 @1) @0) Don't you need cmp:c for this one? The transformation still somehow happens through forward_propagate_into_comparison, but it looks like an accident. > + (cmp @1 { build_zero_cst (TREE_TYPE (@1)); })) > + > + /* (X ^ C1) op C2 can be rewritten as X op (C1 ^ C2). */ > + (simplify > + (cmp (convert?@3 (bit_xor @0 INTEGER_CST@1)) INTEGER_CST@2) > + (if (tree_nop_conversion_p (TREE_TYPE (@3), TREE_TYPE (@0))) > + (cmp @0 (bit_xor @1 (convert @2)))))) I guess we'll have to generalize this to vectors at some point... -- Marc Glisse