From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 101326 invoked by alias); 16 Jun 2017 16:23:22 -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 101138 invoked by uid 89); 16 Jun 2017 16:23:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: mail-vk0-f49.google.com Received: from mail-vk0-f49.google.com (HELO mail-vk0-f49.google.com) (209.85.213.49) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 16 Jun 2017 16:23:19 +0000 Received: by mail-vk0-f49.google.com with SMTP id 191so24899731vko.2 for ; Fri, 16 Jun 2017 09:23:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=X4g3ofhA2b8n+Eo1ftIqE80IFRxY2ADhCjMkG0PpJMw=; b=Khb58zm9ZqWwLa7YmzXg3TzxVnrMTYJsSI91qvo6MZz/5ejJ8hZjtB5/mWrL8FOPPc ugMyBNGUArRyrsojdHg2sRh5tbZYVc8F1VauJuZrrK6zWk4uw/oh/WYjJMN0A8g3Z8cI nVMidUQNmgdX3/s1c0Px5VJB+x45Pg0w3TLvAsvD1RFD1MKi5zEAABY1iXF2t7TDEidf AqZmHkybaI05q+fKPljKSXDQ6DbnzvD2ajVTs7u8ZVY+3LCwD4Aq9I+AUX7WUuJSq5rg U97g+pn0QiD0X3ngy/heoCgAI2yn8gh0iYAOWklnP9C+Ur2EZ27IHA+PGRlSaiQQaDzY 69xw== X-Gm-Message-State: AKS2vOztVhRpbFXv7u5Z900WcqZMfLAuGJ4262mfNALJOJosacn0Uyng ddJcA88L51HXYJsgwDZj52txW8upvg== X-Received: by 10.31.226.196 with SMTP id z187mr6676766vkg.103.1497630202497; Fri, 16 Jun 2017 09:23:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.103.47.19 with HTTP; Fri, 16 Jun 2017 09:23:21 -0700 (PDT) In-Reply-To: References: From: "Bin.Cheng" Date: Fri, 16 Jun 2017 16:23:00 -0000 Message-ID: Subject: Re: [PATCH GCC][1/2]Feed bound computation to folder in loop split To: Richard Biener Cc: "gcc-patches@gcc.gnu.org" Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-06/txt/msg01214.txt.bz2 On Fri, Jun 16, 2017 at 5:16 PM, Richard Biener wrote: > On June 16, 2017 3:31:32 PM GMT+02:00, "Bin.Cheng" wrote: >>On Fri, Jun 16, 2017 at 2:10 PM, Richard Biener >> wrote: >>> On Fri, Jun 16, 2017 at 3:06 PM, Bin.Cheng >>wrote: >>>> On Fri, Jun 16, 2017 at 11:49 AM, Richard Biener >>>> wrote: >>>>> On Wed, Jun 14, 2017 at 3:07 PM, Bin Cheng >>wrote: >>>>>> Hi, >>>>>> Loop split forces intermediate computation to gimple operands all >>the time when >>>>>> computing bound information. This is not good since folding >>opportunities are >>>>>> missed. This patch fixes the issue by feeding all computation to >>folder and only >>>>>> forcing to gimple operand at last. >>>>>> >>>>>> Bootstrap and test on x86_64 and AArch64. Is it OK? >>>>> >>>>> Hm? It uses gimple_build () which should do the same as >>fold_buildN in terms >>>>> of simplification. >>>>> >>>>> So where does that not work? It is supposed to be the prefered way >>and no >>>>> new code should use force_gimple_operand (unless dealing with >>generic >>>>> coming from other middle-end infrastructure like SCEV or niter >>analysis) >>>> Hmm, current code calls force_gimpele operand several times which >>>> causes the inefficiency. The patch avoids that and does one call at >>>> the end. >>> >>> But it forces to the same sequence that is used for extending the >>expression >>> so folding should work. Where do you see that it does not? Note the >>> code uses gimple_build (), not gimple_build_assign (). >>In spec2k6/hmmer, when building fast_algorithms.c with below command >>line: >>./gcc -Ofast -S fast_algorithms.c -o fast_algorithms.S -fdump-tree-all >>-fdump-tree-lsplit >>The lsplit dump contains: >> [12.75%]: >> _124 = _197 + 1; >> _123 = _124 + -1; >> _115 = MIN_EXPR <_197, _124>; >>Which is generated here. > > That means we miss a pattern in match.PD to handle this case. I see. I will withdraw this patch and look in that direction. Thanks, bin > > Richard. > >>Thanks, >>bin >>> >>> Richard. >>> >>>> Thanks, >>>> bin >>>>> >>>>> Richard. >>>>> >>>>>> >>>>>> Thanks, >>>>>> bin >>>>>> 2017-06-12 Bin Cheng >>>>>> >>>>>> * tree-ssa-loop-split.c (compute_new_first_bound): Feed >>bound >>>>>> computation to folder, rather than force to gimple >>operands too >>>>>> early. >