From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31528 invoked by alias); 2 Sep 2015 12:32: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 31515 invoked by uid 89); 2 Sep 2015 12:32:52 -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-f173.google.com Received: from mail-yk0-f173.google.com (HELO mail-yk0-f173.google.com) (209.85.160.173) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Wed, 02 Sep 2015 12:32:47 +0000 Received: by ykcf206 with SMTP id f206so7469715ykc.3 for ; Wed, 02 Sep 2015 05:32:45 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.170.100.137 with SMTP id r131mr3237470yka.20.1441197165216; Wed, 02 Sep 2015 05:32:45 -0700 (PDT) Received: by 10.37.93.136 with HTTP; Wed, 2 Sep 2015 05:32:45 -0700 (PDT) In-Reply-To: <000c01d0e532$823066c0$86913440$@arm.com> References: <000c01d0e532$823066c0$86913440$@arm.com> Date: Wed, 02 Sep 2015 12:32:00 -0000 Message-ID: Subject: Re: [PATCH GCC]Look into unnecessary conversion when checking mult_op in get_shiftadd_cost From: Richard Biener To: Bin Cheng Cc: GCC Patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-09/txt/msg00136.txt.bz2 On Wed, Sep 2, 2015 at 5:50 AM, Bin Cheng wrote: > Hi, > When calling get_shiftadd_cost, the mult_op is stripped at caller places. > We should look into unnecessary conversion in op1 before checking equality, > otherwise it computes wrong shiftadd cost. This patch picks this small > issue up. > > Bootstrap and test on x86_64 and aarch64 along with other patches. Is it > OK? Just do STRIP_NOPS (op1) unconditionally? Thus STRIP_NOPS (op1); mult_in_op1 = operand_equal_p (op1, mult, 0); ok with that change. Thanks, Richard. > Thanks, > bin > > 2015-08-31 Bin Cheng > > * tree-ssa-loop-ivopts.c (get_shiftadd_cost): Look into > unnecessary type conversion for OP1.