From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19551 invoked by alias); 13 Aug 2015 22:10:09 -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 19539 invoked by uid 89); 13 Aug 2015 22:10:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.2 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 13 Aug 2015 22:10:07 +0000 Received: from int-mx11.intmail.prod.int.phx2.redhat.com (int-mx11.intmail.prod.int.phx2.redhat.com [10.5.11.24]) by mx1.redhat.com (Postfix) with ESMTPS id DFACD3725D0; Thu, 13 Aug 2015 22:10:05 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-104.phx2.redhat.com [10.3.113.104]) by int-mx11.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7DMA5nq001277; Thu, 13 Aug 2015 18:10:05 -0400 Subject: Re: [PATCH GCC]Improve loop bound info by simplifying conversions in iv base To: Bin Cheng , gcc-patches@gcc.gnu.org References: <000801d0c919$220d0b70$66272250$@arm.com> From: Jeff Law Message-ID: <55CD15BD.20607@redhat.com> Date: Thu, 13 Aug 2015 22:16:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <000801d0c919$220d0b70$66272250$@arm.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00745.txt.bz2 On 07/28/2015 03:38 AM, Bin Cheng wrote: > Hi, > For now, SCEV may compute iv base in the form of "(signed T)((unsigned > T)base + step))". This complicates other optimizations/analysis depending > on SCEV because it's hard to dive into type conversions. For many cases, > such type conversions can be simplified with additional range information > implied by loop initial conditions. This patch does such simplification. > With simplified iv base, loop niter analysis can compute more accurate bound > information since sensible value range can be derived for "base+step". For > example, accurate loop bound&may_be_zero information is computed for cases > added by this patch. > The code is actually borrowed from loop_exits_before_overflow. Moreover, > with simplified iv base, the second case handled in that function now > becomes the first case. I didn't remove that part of code because it may(?) > still be visited in scev analysis itself and simple_iv isn't an interface > for that. > > Is it OK? > > Thanks, > bin > > 2015-07-28 Bin Cheng > > * tree-ssa-loop-niter.c (tree_simplify_using_condition): Export > the interface. > * tree-ssa-loop-niter.h (tree_simplify_using_condition): Declare. > * tree-scalar-evolution.c (simple_iv): Simplify type conversions > in iv base using loop initial conditions. > > gcc/testsuite/ChangeLog > 2015-07-28 Bin Cheng > > * gcc.dg/tree-ssa/loop-bound-2.c: New test. > * gcc.dg/tree-ssa/loop-bound-4.c: New test. > * gcc.dg/tree-ssa/loop-bound-6.c: New test. I have the same concerns about these tests... Which makes me really think I must be mis-understanding something in the debugging output. jeff