From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 93831 invoked by alias); 17 Feb 2017 10:20:08 -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 93803 invoked by uid 89); 17 Feb 2017 10:20:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.4 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=H*f:sk:8ba9c9f, H*i:sk:8ba9c9f, road, office X-HELO: mail-vk0-f54.google.com Received: from mail-vk0-f54.google.com (HELO mail-vk0-f54.google.com) (209.85.213.54) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 17 Feb 2017 10:19:57 +0000 Received: by mail-vk0-f54.google.com with SMTP id t8so26448107vke.3 for ; Fri, 17 Feb 2017 02:19:57 -0800 (PST) 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=zMzzdm7XJHAIfsij5jTL7wGW/Fwf4DIEwgtzaMNu0JQ=; b=G7zW1ScifCU+z0fXsNJ39aduqLDgtKPnyzBHYh50FjfysAUsoiS2CyYAsfQRS5upF4 H7bAKjfKUIj9DxXTzkdxhFiOues4Z3WiyE/q4doLQukHt1H30PcfamAadJs3fnMDqPPO wYYFd3fGkqEsQ8HMbnhArfEYsSlNp9/cVOpdRakgkjcOrK+xEXFuPLnKxAUTFUbfi5DT 5N2XEsejbnKYe50wkyB+lpaBK38dEoBFT5FXjeQE9JRQgSyvHbtXnz2SXjbLv78lSB9+ /5iNECnQacsLKW1TeGjG9E1fvasBrJ0yIt/WHt3ZwuOLH20kl8yx2OrB2j8lZSV3XzKL 1pfg== X-Gm-Message-State: AMke39l2Vq5vwac73+/abaon/IfHtj3K5MhRoXrYGXJ/6zEbdjGd77wp37nZIRxoxMxdAAuAUT/G8jgLfh4qSQ== X-Received: by 10.31.172.211 with SMTP id v202mr3686483vke.125.1487326795784; Fri, 17 Feb 2017 02:19:55 -0800 (PST) MIME-Version: 1.0 Received: by 10.103.72.157 with HTTP; Fri, 17 Feb 2017 02:19:55 -0800 (PST) In-Reply-To: <8ba9c9f5-f218-62f2-51e4-2976f84b6380@redhat.com> References: <8ba9c9f5-f218-62f2-51e4-2976f84b6380@redhat.com> From: "Bin.Cheng" Date: Fri, 17 Feb 2017 10:23:00 -0000 Message-ID: Subject: Re: [PATCH PR71437/V2]Simplify cond with assertions in threading To: Jeff Law Cc: Bin Cheng , "gcc-patches@gcc.gnu.org" , nd Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2017-02/txt/msg01099.txt.bz2 On Fri, Feb 17, 2017 at 3:40 AM, Jeff Law wrote: > On 02/14/2017 03:05 AM, Bin Cheng wrote: >> >> Hi, >> This is the second try fixing PR71437. The old version patch tried to fix >> issue in VRP but it requires further non-trivial change in VRP, >> specifically, to better support variable value ranges. This is not >> appropriate at stage 4. Alternatively, this patch tries to fix issue by >> improving threading. It additionally simplifies condition by using >> assertion conditions. >> >> Bootstrap and test on x86_64 and AArch64. Is it OK? >> >> Thanks, >> bin >> >> 2017-02-13 Bin Cheng >> >> PR tree-optimization/71437 >> * tree-ssa-loop-niter.c (tree_simplify_using_condition): Only >> expand condition if new parameter says so. Also change it to >> global. >> * tree-ssa-loop-niter.h (tree_simplify_using_condition): New >> declaration. >> * tree-ssa-threadedge.c (tree-ssa-loop-niter.h): New include file. >> (simplify_control_stmt_condition_1): Simplify condition using >> assert conditions. >> >> gcc/testsuite/ChangeLog >> 2017-02-13 Bin Cheng >> >> PR tree-optimization/71437 >> * gcc.dg/tree-ssa/pr71437.c: New test. >> > So following up. We're not going to get anywhere using the ranges in VRP. > As Bin noted in the V1 patch, VRP prefers a useless range with constant > bounds when a symbolic range would be better. Thus the callbacks into VRP > are doomed to failure. > > Bin's patch works around this by using the ASSERT_EXPRs to recover the > symbolic range. So it's a bit of a hack, but not a terrible one. If we > want to continue this path, we might still look for ways to avoid > simplify_using_condition. > > One idea would be to go ahead and record the equivalence from the > ASSERT_EXPR into the expression hash table and use the expression hash table > to simplify the condition. We didn't have that ability in the past, but > should now after the refactorings from last year. > > It's slightly related to some ideas I've got around tackling 78496. > > I'm in/out of the office for until the 27th semi-randomly. I'll try to poke > at this while on the road. Thanks for helping, I will hold this patch and let you work out a generic fix in threading. Thanks, bin > > Jeff > >