From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9728 invoked by alias); 24 Oct 2014 03:17:12 -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 9688 invoked by uid 89); 24 Oct 2014 03:17:08 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-4.5 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS,SPF_PASS autolearn=ham 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; Fri, 24 Oct 2014 03:17:07 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s9O3H4Jl009101 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 23 Oct 2014 23:17:05 -0400 Received: from VMBP.local (vpn-55-248.rdu2.redhat.com [10.10.55.248]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id s9O3H3i3016970; Thu, 23 Oct 2014 23:17:04 -0400 Message-ID: <5449C4AF.7080807@redhat.com> Date: Fri, 24 Oct 2014 03:21:00 -0000 From: Vladimir Makarov User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.2.0 MIME-Version: 1.0 To: Maxim Kuvyrkov CC: gcc-patches@gcc.gnu.org Subject: Re: [PATCH 3/8] Remove cached_first_cycle_multipass_dfa_lookahead and cached_issue_rate References: <5446815C.6050609@redhat.com> In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-10/txt/msg02462.txt.bz2 On 2014-10-22 11:29 PM, Maxim Kuvyrkov wrote: > On Oct 22, 2014, at 4:53 AM, Vladimir Makarov wrote: > >> On 10/20/2014 11:16 PM, Maxim Kuvyrkov wrote: >>> Hi, >>> >>> This patch cleans up (removes) cached_first_cycle_multipass_dfa_lookahead and cached_issue_rate. >>> >>> These seem to be an artifact from the scheduler refactoring 10+ years ago. They assume that dfa_lookahead and issue_rate can change mid-way through scheduling, which is never the case. All backends currently treat dfa_lookahead and issue_rate as constants for the duration of scheduling passes. >>> >>> Bootstrapped on x86_64-linux-gnu. Regression testing is in progress. OK to commit if no regressions? >>> >> Yes. the patch for issue rate itself is ok but you should have modified >> doc/tm.texi too for dfa lookahead hook saying that it should be a >> constant (issue rate already has such clause). >> >> On the other hand I'd not assume that dfa look ahead is a constant. In >> future we could make it non-constant to differentiate non-hot and hot >> functions to speed up the scheduler as dfa look ahead scheduling is >> pretty expensive. >> >> So issue rate change is ok but I'd not rush to change dfa look ahead >> related code. > > It is trivial to prove that currently cached_first_cycle_multipass_dfa_lookahead always has the same value as dfa_lookahead. And, even should targetm.sched.first_cycle_multipass_dfa_lookahead start returning different values, max_issue will happily continue to use the value that the hook returned in sched_init(). > > Also, your suggestion to use different dfa_lookahead values for hot/cold functions is not affected by this patch. The values of dfa_lookahead variable have scope of the scheduling pass, which is invoked separately for every function. > > I guess, you could, potentially, start differentiating values of dfa_lookahead based on whether a basic_block is hot or cold, but handling this scenario would require significant changes throughout the scheduler. > > To summarize, dfa_lookahead is currently a pass-time invariant, that is free to change between invocations of the scheduler pass. Cached_first_cycle_multipass_dfa_lookahead always holds the same value as dfa_lookahead, and, as such, is extraneous. > Ok, then. It was a temporary intermediate stage very long ago. But temporary solutions become permanent ones. I don't think I'll find a time to work on implementing such feature (differentiating lookahead for cold/hot BBs). The patch is ok without my previous request. Thanks, Maxim.