From patchwork Tue Jun 10 09:32:28 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zhenqiang Chen X-Patchwork-Id: 31610 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ob0-f200.google.com (mail-ob0-f200.google.com [209.85.214.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 2C46420675 for ; Tue, 10 Jun 2014 09:32:48 +0000 (UTC) Received: by mail-ob0-f200.google.com with SMTP id wo20sf41369260obc.3 for ; Tue, 10 Jun 2014 02:32:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:mailing-list:precedence:list-id :list-unsubscribe:list-archive:list-post:list-help:sender :delivered-to:mime-version:date:message-id:subject:from:to :x-original-sender:x-original-authentication-results:content-type; bh=01Iyrf2Opvyh2IUNAHb62Y997Z52MS0W9OEgboKS6bI=; b=KsWwEThOuI9P/K9Tkk7yPg6IvBRAgef3nXO+AFsiMqTYF2QnbxFJ+VkJ8eBZmf0MFX HAAFJjsF7sOTPhegEJHvKSqV5DHVG4kG/fijWnkVtGQnHJ23TPddQn7pWDW+ndN07RYk xUkQM3ycrETd5+dqVZ2ldNZXwGfLv1qc9jZtRW/JoNB9ZNZoNpETNqIIlBshZQAUhqC0 i1gvyuOI0U7Gr3cCye2dGwTg1FG7n7ZoFaR0bB96jaOBzTAmrLPIB7/o2bCEqjokAuel FR7lV21g7YiQhStm5jmFZQAWxZ9OvuOlG6+d3e5cFv7jdZpO84eVJy+yUpNCvou/pRay 8X7A== X-Gm-Message-State: ALoCoQlu5BfAMVed5YTy9PVeUT4lPtsPOrmlc467OpRNsIQw75RIsTszamatAsrMkMMIzdw61w14 X-Received: by 10.50.61.146 with SMTP id p18mr2896925igr.3.1402392767529; Tue, 10 Jun 2014 02:32:47 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.140.89.104 with SMTP id u95ls2027236qgd.5.gmail; Tue, 10 Jun 2014 02:32:47 -0700 (PDT) X-Received: by 10.52.85.165 with SMTP id i5mr26740298vdz.53.1402392767426; Tue, 10 Jun 2014 02:32:47 -0700 (PDT) Received: from mail-ve0-x22d.google.com (mail-ve0-x22d.google.com [2607:f8b0:400c:c01::22d]) by mx.google.com with ESMTPS id pd4si12891188vec.35.2014.06.10.02.32.47 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 10 Jun 2014 02:32:47 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c01::22d as permitted sender) client-ip=2607:f8b0:400c:c01::22d; Received: by mail-ve0-f173.google.com with SMTP id db11so2436341veb.18 for ; Tue, 10 Jun 2014 02:32:47 -0700 (PDT) X-Received: by 10.58.120.195 with SMTP id le3mr10883210veb.7.1402392767310; Tue, 10 Jun 2014 02:32:47 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.221.54.6 with SMTP id vs6csp211222vcb; Tue, 10 Jun 2014 02:32:46 -0700 (PDT) X-Received: by 10.66.102.4 with SMTP id fk4mr4143852pab.59.1402392765619; Tue, 10 Jun 2014 02:32:45 -0700 (PDT) Received: from sourceware.org (server1.sourceware.org. [209.132.180.131]) by mx.google.com with ESMTPS id hr2si33700985pbb.187.2014.06.10.02.32.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 10 Jun 2014 02:32:45 -0700 (PDT) Received-SPF: pass (google.com: domain of gcc-patches-return-369867-patch=linaro.org@gcc.gnu.org designates 209.132.180.131 as permitted sender) client-ip=209.132.180.131; Received: (qmail 5709 invoked by alias); 10 Jun 2014 09:32:34 -0000 Mailing-List: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 5698 invoked by uid 89); 10 Jun 2014 09:32:33 -0000 X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.5 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-lb0-f174.google.com Received: from mail-lb0-f174.google.com (HELO mail-lb0-f174.google.com) (209.85.217.174) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 10 Jun 2014 09:32:32 +0000 Received: by mail-lb0-f174.google.com with SMTP id n15so3752676lbi.19 for ; Tue, 10 Jun 2014 02:32:29 -0700 (PDT) MIME-Version: 1.0 X-Received: by 10.112.131.8 with SMTP id oi8mr341932lbb.87.1402392748800; Tue, 10 Jun 2014 02:32:28 -0700 (PDT) Received: by 10.112.13.36 with HTTP; Tue, 10 Jun 2014 02:32:28 -0700 (PDT) Date: Tue, 10 Jun 2014 17:32:28 +0800 Message-ID: Subject: [PATCH, loop2_invariant] Skip inv (marked as move) from depends_on From: Zhenqiang Chen To: "gcc-patches@gcc.gnu.org" X-IsSubscribed: yes X-Original-Sender: zhenqiang.chen@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 2607:f8b0:400c:c01::22d as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org; dkim=pass header.i=@gcc.gnu.org X-Google-Group-Id: 836684582541 Hi, The patch skips an invariant from depends_on if it has been marked as "move" since its register pressure and cost had been taken into account in previous iterations. Bootstrap and no make check regression on X86-64. Bootstrap and no make check regression on X86-64 with flag_ira_loop_pressure = true. OK for trunk? Thanks! -Zhenqiang ChangeLog: 2014-06-10 Zhenqiang Chen * loop-invariant.c (get_inv_cost): Skip invariants, which are marked as "move", from depends_on. if (! flag_ira_loop_pressure) diff --git a/gcc/loop-invariant.c b/gcc/loop-invariant.c index e822bb6..fca9c2f 100644 --- a/gcc/loop-invariant.c +++ b/gcc/loop-invariant.c @@ -1148,6 +1148,10 @@ get_inv_cost (struct invariant *inv, int *comp_cost, unsigned *regs_needed, dep = invariants[depno]; + /* If DEP is moved out of the loop, it is not a depends_on any more. */ + if (dep->move) + continue; + dep_ret = get_inv_cost (dep, &acomp_cost, aregs_needed, &dep_cl);