From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 92570 invoked by alias); 13 Oct 2015 12:50:43 -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 92534 invoked by uid 89); 13 Oct 2015 12:50:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-yk0-f169.google.com Received: from mail-yk0-f169.google.com (HELO mail-yk0-f169.google.com) (209.85.160.169) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Tue, 13 Oct 2015 12:50:41 +0000 Received: by ykfs79 with SMTP id s79so2638616ykf.2 for ; Tue, 13 Oct 2015 05:50:39 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.129.125.6 with SMTP id y6mr23976166ywc.5.1444740639626; Tue, 13 Oct 2015 05:50:39 -0700 (PDT) Received: by 10.37.93.136 with HTTP; Tue, 13 Oct 2015 05:50:39 -0700 (PDT) In-Reply-To: References: Date: Tue, 13 Oct 2015 12:50:00 -0000 Message-ID: Subject: Re: Move some bit and binary optimizations in simplify and match From: Richard Biener To: GCC Patches Cc: "Hurugalawadi, Naveen" Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-10/txt/msg01235.txt.bz2 On Tue, Oct 13, 2015 at 2:18 PM, Marc Glisse wrote: > On Tue, 13 Oct 2015, Richard Biener wrote: > >> +/* Simplify ~X & X as zero. */ >> +(simplify >> + (bit_and:c (convert? @0) (convert? (bit_not @0))) >> + (if (tree_nop_conversion_p (type, TREE_TYPE (@0))) > > > The test seems unnecessary for this specific transformation. > >> + { build_zero_cst (TREE_TYPE (@0)); })) > > > I'd rather build_zero_cst (type) directly. > >> +/* (-A) * (-B) -> A * B */ >> +(simplify >> + (mult:c (convert? (negate @0)) (convert? negate_expr_p@1)) >> + (if (tree_nop_conversion_p (type, TREE_TYPE (@0))) >> + (mult (convert @0) (convert (negate @1))))) >> >> this one is ok with using convert1? and convert2? > > > Is it? Maybe if it also checked tree_nop_conversion_p for @1... Sorry, your comments are of course correct. Neveen, please adjust also according to these comments. Richard. > -- > Marc Glisse