From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 69745 invoked by alias); 1 Jun 2015 10:46:02 -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 69725 invoked by uid 89); 1 Jun 2015 10:46:00 -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-oi0-f42.google.com Received: from mail-oi0-f42.google.com (HELO mail-oi0-f42.google.com) (209.85.218.42) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 01 Jun 2015 10:45:59 +0000 Received: by oihb142 with SMTP id b142so97903705oih.3 for ; Mon, 01 Jun 2015 03:45:57 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.182.56.4 with SMTP id w4mr17657136obp.79.1433155557419; Mon, 01 Jun 2015 03:45:57 -0700 (PDT) Received: by 10.76.115.167 with HTTP; Mon, 1 Jun 2015 03:45:57 -0700 (PDT) In-Reply-To: <000001d097a3$c846a200$58d3e600$@arm.com> References: <000001d097a3$c846a200$58d3e600$@arm.com> Date: Mon, 01 Jun 2015 10:46:00 -0000 Message-ID: Subject: Re: [PATCH GCC]Improve how we handle overflow in scev by using overflow information computed for control iv in loop niter, part II From: Richard Biener To: Bin Cheng Cc: GCC Patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2015-06/txt/msg00037.txt.bz2 On Tue, May 26, 2015 at 1:04 PM, Bin Cheng wrote: > Hi, > My first part patch improving how we handle overflow in scev is posted at > https://gcc.gnu.org/ml/gcc-patches/2015-05/msg01795.html . Here comes the > second part patch. > > This patch does below improvements: > 1) Computes and records control iv for each loop's exit edge. This > provides a way to compute overflow information in loop niter and use it in > different customers. It think it's useful, especially with option > -funsafe-loop-optimizers. > 2) Improve chrec_convert by adding new interface > loop_exits_before_overflow. It checks if a converted IV overflows wrto its > type and loop using overflow information of loop's control iv. This > basically propagates no-overflow information from control iv to ivs > converted from control iv. Moreover, we can further improve the logic by > using possible VRP information in the future. But 2) you already posted (and I have approved it but you didn't commit yet?). Can you commit that approved patch and only send the parts I didn't approve yet? Thanks, Richard. > With this patch, cases like scev-9.c and scev-10.c in patch can be handled > now. Cases reported in PR48052 can be vectorized too. > Opinions? > > Thanks, > bin > > > 2015-05-26 Bin Cheng > > * cfgloop.h (struct control_iv): New. > (struct loop): New field control_ivs. > * tree-ssa-loop-niter.c : Include "stor-layout.h". > (number_of_iterations_lt): Set no_overflow information. > (number_of_iterations_exit): Init control iv in niter struct. > (record_control_iv): New. > (estimate_numbers_of_iterations_loop): Call record_control_iv. > (loop_exits_before_overflow): New. Interface factored out of > scev_probably_wraps_p. > (scev_probably_wraps_p): Factor loop niter related code into > loop_exits_before_overflow. > (free_numbers_of_iterations_estimates_loop): Free control ivs. > * tree-ssa-loop-niter.h (free_loop_control_ivs): New. > > gcc/testsuite/ChangeLog > 2015-05-26 Bin Cheng > > PR tree-optimization/48052 > * gcc.dg/tree-ssa/scev-8.c: New. > * gcc.dg/tree-ssa/scev-9.c: New. > * gcc.dg/tree-ssa/scev-10.c: New. > * gcc.dg/vect/pr48052.c: New. >