From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 114967 invoked by alias); 17 Apr 2015 03:19:36 -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 114908 invoked by uid 89); 17 Apr 2015 03:19:27 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pa0-f52.google.com Received: from mail-pa0-f52.google.com (HELO mail-pa0-f52.google.com) (209.85.220.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Fri, 17 Apr 2015 03:19:25 +0000 Received: by paboj16 with SMTP id oj16so110988755pab.0 for ; Thu, 16 Apr 2015 20:19:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=LiRaNP6836gY1P1u4trM5BRsKYEPdvPZyd6VT1jByxw=; b=BlxndwJP9ZwqpHKXCZqvzv7YIXviF7szvo3Mu/p3Jm84lE/dxe6C5rkmsm0L12PJhm 6c8CNordqQuedaeW66Gds8BKiPpfNRJ2k4q0xvO1Hbb3b8/7srfwqpjNBw+YcxSm2de9 kctl14fXRDme/WYHm8i8tYPvvE0WVL04pozF69nAnGD9Rf7JCGcSUY0aV4gHhmfrSxO6 aORW3NL1jeAnUKmY3o5F+seglZnt4nsFMpveSbXZQ0B4Y+dmgGWpdS458tc1Ap3vtRgx 8kFmZswqEyQmNecMQBF1+6YamZTU2ulmZwSYPs8HnMEm1pjGwM5U9E09VeFcfoOyL7F+ MDOQ== X-Gm-Message-State: ALoCoQk33oz18E5CEjWeYHlIcZQjUFrXkujfDKBHTac/IaPBW3mOuYtLBV3S1SbqFLkBMO8kjNcr X-Received: by 10.68.244.233 with SMTP id xj9mr1609570pbc.35.1429240763670; Thu, 16 Apr 2015 20:19:23 -0700 (PDT) Received: from [10.1.1.5] (58-6-183-210.dyn.iinet.net.au. [58.6.183.210]) by mx.google.com with ESMTPSA id xv9sm8495266pbc.2.2015.04.16.20.19.21 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Apr 2015 20:19:22 -0700 (PDT) Message-ID: <55307BB5.50907@linaro.org> Date: Fri, 17 Apr 2015 03:19:00 -0000 From: Kugan User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Richard Biener , Steven Bosscher CC: "gcc-patches@gcc.gnu.org" Subject: Re: [PR65768] Check rtx_cost when propagating constant References: <552E1907.4090708@linaro.org> In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2015-04/txt/msg00845.txt.bz2 On 15/04/15 21:18, Richard Biener wrote: > On Wed, Apr 15, 2015 at 11:05 AM, Steven Bosscher wrote: >> On Wed, Apr 15, 2015 at 9:53 AM, Kugan wrote: >>> 2015-04-15 Kugan Vivekanandarajah < > >>> Zhenqiang Chen <> >>> >>> PR target/65768 >>> * cprop.c (try_replace_reg): Check cost of constants before propagating. >> >> >>> + >>> + /* For CONSTANT_P (to), loop2_invariant pass might hoist it out the loop. >>> + And it can be shared by different references. So skip propagation if >>> + it makes INSN's rtx cost higher. */ >>> + >> >> So only undo if the insn is inside a loop (i.e. >> BLOCK_FOR_INSN(insn)->loop_father != NULL) and this is a >> post-pass_loop2 cprop run? > > post loop2 loops are destroyed. When loops are available loop_father > is always non-NULL, the proper check is for loop_outer (->loop_father) == NULL. > or loop_depth (->loop_father) != 0. Thanks Steven and Richard for the comments. If the loop information is present, we could have used this. But even otherwise, we are just limiting the cprop of an expensive constant (based on the rtx_cost). I understand that Richard was a bit concerned about extending the live range but this is a trade off. As per his previous mail, Zhenqiang did some benchmarking. I am happy to do further benchmarking if you want to see that. Probably the rematerialization that is being introduced in IRA/LRA can redo this if it sees there is high register pressure. Any thoughts? Thanks, Kugan