From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4590 invoked by alias); 31 May 2011 08:04:59 -0000 Received: (qmail 4578 invoked by uid 22791); 31 May 2011 08:04:58 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from nikam.ms.mff.cuni.cz (HELO nikam.ms.mff.cuni.cz) (195.113.20.16) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 31 May 2011 08:04:44 +0000 Received: by nikam.ms.mff.cuni.cz (Postfix, from userid 29025) id 52DC59AC7CF; Tue, 31 May 2011 10:04:42 +0200 (CEST) Date: Tue, 31 May 2011 09:11:00 -0000 From: Zdenek Dvorak To: Tom de Vries Cc: gcc-patches@gcc.gnu.org Subject: Re: [PATCH PR45098, 7/10] Nowrap limits iterations Message-ID: <20110531080442.GA19683@kam.mff.cuni.cz> References: <4DD21F6E.4050308@codesourcery.com> <4DD221CF.4040002@codesourcery.com> <4DD3FD79.2020804@codesourcery.com> <20110518211157.GA19788@kam.mff.cuni.cz> <4DD63AE1.7070600@codesourcery.com> <20110521122407.GA22860@kam.mff.cuni.cz> <4DD7FD8F.20909@codesourcery.com> <4DE110D3.8080904@codesourcery.com> <20110530123851.GA29240@kam.mff.cuni.cz> <4DE49E91.60502@codesourcery.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4DE49E91.60502@codesourcery.com> User-Agent: Mutt/1.5.18 (2008-05-17) 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: 2011-05/txt/msg02395.txt.bz2 Hi, > As far as I can tell, what is current calculated in i_bound (and assigned to > nb_iterations_upper_bound), is the maximum amount of times any statement in the > loop is executed, where any includes exit tests. Differently put, the maximum > amount of times the loop header is executed. hmm... this is rather confusing, I don't really recall why I gave nb_iterations_upper_bound a different semantics from any other instance of what # of iterations of a loop means. > This is confirmed by this comment in tree-vrp.c: > > /* Try to use estimated number of iterations for the loop to constrain the > final value in the evolution. > We are interested in the number of executions of the latch, while > nb_iterations_upper_bound includes the last execution of the exit test. */ > > I modified the patch to improved the comment. I think a better fix would be to make the nb_iterations_upper_bound semantics consistent with that of nb_iterations. Let me try to do it, hopefully this should be mostly mechanical, Zdenek