From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31947 invoked by alias); 7 Nov 2017 10:45:38 -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 31930 invoked by uid 89); 7 Nov 2017 10:45:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.1 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Previous, dominating, Hx-languages-length:2217, story X-HELO: mail-wm0-f48.google.com Received: from mail-wm0-f48.google.com (HELO mail-wm0-f48.google.com) (74.125.82.48) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 07 Nov 2017 10:45:32 +0000 Received: by mail-wm0-f48.google.com with SMTP id r196so2823782wmf.2 for ; Tue, 07 Nov 2017 02:45:31 -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=39SNDUaQ/OMUP55N+QVW7HEMZdnzj3DR1gzSbpMetU0=; b=Hyn3LQ0J2tuOOYUg+UJXi3ngQGT9MHQ53eAX9rkPsH1lzNmHMxGIvB3q9dIXnqLu8m cTx7t1n/kJwGN5wnMBdvwvSNmoAnTceYCE3bN4UEeS/zymr+VR3cfS5+GrAckIFyMs5b EnJcfF7/QqBDu0bSNrICMpC4oD1CBIAKSCxiMjx+iseFwTbjjtrA+UPBERV1EkE6OwHe zyiXXzQap1njA0bZHlZ5iyxgYC9YCTtEsUNbKXKq9ZnfuBL7mcCSqFFnNgDvovyUz6o2 3JkA46MtBViC4LdeMamAbUda4WnPvpQZCfq8Hg4szeG0FWHoIqX46Z0+tFhveYTP278b QA1A== X-Gm-Message-State: AMCzsaX+txyBigF0Lz8oXGaRlAhqcbbdhQUiMA8kfgnSLmzBiz5PY3K/ qhDK4JoVsfgDUnubcqajFPWjZSX3TarEvN6gamsxUw== X-Google-Smtp-Source: ABhQp+SDM0kZoUSNp06l/dqoqeXjl3AanGl9C+nN72ib+ppjU431Nyl4l0FP+HI6uR+zr1Ec+76C1Dq/5acWVPXd6r8= X-Received: by 10.80.194.217 with SMTP id u25mr23961953edf.260.1510051529997; Tue, 07 Nov 2017 02:45:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.80.143.34 with HTTP; Tue, 7 Nov 2017 02:45:29 -0800 (PST) In-Reply-To: References: From: Richard Biener Date: Tue, 07 Nov 2017 10:49:00 -0000 Message-ID: Subject: Re: [PATCH PR82726][1/2]Revert previous fixes for PR70754 and PR79663 To: Bin Cheng Cc: "gcc-patches@gcc.gnu.org" , nd Content-Type: text/plain; charset="UTF-8" X-IsSubscribed: yes X-SW-Source: 2017-11/txt/msg00474.txt.bz2 On Fri, Nov 3, 2017 at 1:39 PM, Bin Cheng wrote: > Hi, > When fixing PR70754, I thought the issue only happens for ZERO-length chains. > Well, that's apparently not true with PR82726. > The whole story is, with chain combination/re-association, new stmts may be > created/inserted at position not dominating following uses. This happens in > two scenarios: > 1) Zero length chains, as in PR70754. > 2) Non-zero chains with multiple zero distance references. > PR82726 falls in case 2). Because zero distance references are root of the > chain, they don't inherit values from loop carried PHIs. In code generation, > we still need to be careful not inserting use before definitions. > > Previous fix to PR70754 tries to find dominance position for insertion when > combining all references. I could do the similar thing on top of that fix, > but it would be inefficient/complicated because we should only do that for > zero distance references in a non-zero length combined chain. > > This patch set fixes both PRs in the opposite way: Instead of finding dominance > insertion position for root reference, we re-sort zero-distance references of > combined chain by their position information so that new root reference must > dominate others. This should be more efficient because we avoid function call > to stmt_dominates_stmt_p. > > This is the first patch reverting r244815 and r245689. > > Bootstrap and test on x86_64 and AArch64 in patch set. Is it OK? Ok. Richard. > Thanks, > bin > 2017-11-02 Bin Cheng > > PR tree-optimization/82726 > Revert > 2017-01-23 Bin Cheng > > PR tree-optimization/70754 > * tree-predcom.c (stmt_combining_refs): New parameter INSERT_BEFORE. > (reassociate_to_the_same_stmt): New parameter INSERT_BEFORE. Insert > combined stmt before it if not NULL. > (combine_chains): Process refs reversely and compute dominance point > for root ref. > > Revert > 2017-02-23 Bin Cheng > > PR tree-optimization/79663 > * tree-predcom.c (combine_chains): Process refs in reverse order > only for ZERO length chains, and add explaining comment.