From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16272 invoked by alias); 1 Dec 2012 19:22:33 -0000 Received: (qmail 16262 invoked by uid 22791); 1 Dec 2012 19:22:32 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-qa0-f47.google.com (HELO mail-qa0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 01 Dec 2012 19:22:22 +0000 Received: by mail-qa0-f47.google.com with SMTP id a19so469440qad.20 for ; Sat, 01 Dec 2012 11:22:21 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.185.212 with SMTP id cp20mr9627412qab.2.1354389741312; Sat, 01 Dec 2012 11:22:21 -0800 (PST) Received: by 10.49.12.210 with HTTP; Sat, 1 Dec 2012 11:22:21 -0800 (PST) In-Reply-To: <20121031103949.GD19020@kam.mff.cuni.cz> References: <20121031103949.GD19020@kam.mff.cuni.cz> Date: Sat, 01 Dec 2012 19:22:00 -0000 Message-ID: Subject: Re: Non-dominating loop bounds in tree-ssa-loop-niter 3/4 From: "H.J. Lu" To: Jan Hubicka Cc: gcc-patches@gcc.gnu.org, rguenther@suse.de Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes 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 X-SW-Source: 2012-12/txt/msg00034.txt.bz2 On Wed, Oct 31, 2012 at 3:39 AM, Jan Hubicka wrote: > Hi, > this patch implements the logic to remove statements that are known to be > undefined and thus expected to not be executed after unrolling. It also > removes redundant exits that I originally tried to do at once, but it > does not fly, since the peeling confuse number_of_iterations_exit > and it no longer understands the ivs. > > So now we > 1) always remove exits that are known to be redundant by the bounds found > 2) try to peel/unroll > 3) if success remove statemnts from the last iteration > > This silence the array-bounds warnings in my testcase and many cases of > -O3 bootstrap (I am running it now). > Still if one construct testcase touching out of bound in more than one > iteration we will produce false warning, I will do that incrementally > by similar logic in loop copying. > > Bootstrapped/regtested x86_64-linux, OK? > > Honza > > * tree-ssa-loop-niter.c (free_loop_bounds): Break out from ... > (free_numbers_of_iterations_estimates_loop): ... here. > * tree-ssa-loop-ivcanon.c (remove_exits_and_undefined_stmts): New > function. > (remove_redundant_iv_test): New function. > (try_unroll_loop_completely): Pass in MAXITER; use > remove_exits_and_undefined_stmts > (canonicalize_loop_induction_variables): Compute MAXITER; > use remove_redundant_iv_test. > * cfgloop.h (free_loop_bounds): New function. > > * gcc.dg/tree-ssa/cunroll-10.c: New testcase. > * gcc.dg/tree-ssa/cunroll-9.c: New testcase. This caused: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=55555 -- H.J.