From patchwork Thu Sep 21 14:28:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Segher Boessenkool X-Patchwork-Id: 816892 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-462710-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="aXXpSUBz"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3xyfB44TThz9s7f for ; Fri, 22 Sep 2017 00:29:00 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; q=dns; s=default; b=lmf/CJAnR8Vc HwTp8zOXxKS+EnNwnprO486BlRnPU8c5HHLkq/adXHWPGn03/9ykkXS9coqwFBBY rWpePOJSl++damLGYtHkFslAWJ5+Cj6sMhKuF+0Z3xOTGclCbdrYS7acQM/2ff/r WekjJTPY3I8ttjKlLn+FHpIV0JqNOFM= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:from :to:cc:subject:date:message-id; s=default; bh=oRuhJal4j971yuu9yo KU3mWgZbY=; b=aXXpSUBz0fe0H7K5ROpRQMiZlMNYjcwp2+Hc3fZqi3PTO065o1 4Sh5D61mCcKsiF4BeEFHLfNPiCwv+kcPn+VJeFkxAde8d939WrAeg6pg70eoUlS3 mTuyHaPvGguXyORtZtWHpgduPOQWslFhXYrvGj7uKLDMSQADkW22EiadY= Received: (qmail 111903 invoked by alias); 21 Sep 2017 14:28:52 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk 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 111881 invoked by uid 89); 21 Sep 2017 14:28:51 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-24.1 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, KAM_LAZY_DOMAIN_SECURITY, RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy= X-HELO: gcc1-power7.osuosl.org Received: from gcc1-power7.osuosl.org (HELO gcc1-power7.osuosl.org) (140.211.15.137) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 21 Sep 2017 14:28:49 +0000 Received: by gcc1-power7.osuosl.org (Postfix, from userid 10019) id 4590D1240160; Thu, 21 Sep 2017 14:28:48 +0000 (UTC) From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Cc: Segher Boessenkool Subject: [PATCH] Rename existing insn_cost to insn_sched_cost Date: Thu, 21 Sep 2017 14:28:45 +0000 Message-Id: <01cd3b1eb6c8f0ef336ce2850dcd2edf52b11684.1506003847.git.segher@kernel.crashing.org> X-IsSubscribed: yes haifa-sched exports an insn_cost function, but it is only used in a few places and specialised to scheduling. This patch renames it to insn_sched_cost. Okayed by Jeff at https://gcc.gnu.org/ml/gcc-patches/2017-08/msg00202.html, committing it now. Segher 2017-09-21 Segher Boessenkool * haifa-sched.c: Rename insn_cost to insn_sched_cost. * sched-rgn.c: Ditto. * sel-sched-ir.c: Ditto. --- gcc/haifa-sched.c | 14 +++++++------- gcc/sched-int.h | 2 +- gcc/sched-rgn.c | 4 ++-- gcc/sel-sched-ir.c | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/gcc/haifa-sched.c b/gcc/haifa-sched.c index af0ed27..d1378d0 100644 --- a/gcc/haifa-sched.c +++ b/gcc/haifa-sched.c @@ -225,7 +225,7 @@ struct common_sched_info_def *common_sched_info; #define FEEDS_BACKTRACK_INSN(INSN) (HID (INSN)->feeds_backtrack_insn) #define SHADOW_P(INSN) (HID (INSN)->shadow_p) #define MUST_RECOMPUTE_SPEC_P(INSN) (HID (INSN)->must_recompute_spec) -/* Cached cost of the instruction. Use insn_cost to get cost of the +/* Cached cost of the instruction. Use insn_sched_cost to get cost of the insn. -1 here means that the field is not initialized. */ #define INSN_COST(INSN) (HID (INSN)->cost) @@ -1383,7 +1383,7 @@ static rtx_insn *nonscheduled_insns_begin; This is the number of cycles between instruction issue and instruction results. */ int -insn_cost (rtx_insn *insn) +insn_sched_cost (rtx_insn *insn) { int cost; @@ -1470,7 +1470,7 @@ dep_cost_1 (dep_t link, dw_t dw) { enum reg_note dep_type = DEP_TYPE (link); - cost = insn_cost (insn); + cost = insn_sched_cost (insn); if (INSN_CODE (insn) >= 0) { @@ -1608,11 +1608,11 @@ priority (rtx_insn *insn) INSN_FUSION_PRIORITY (insn) = this_fusion_priority; } else if (dep_list_size (insn, SD_LIST_FORW) == 0) - /* ??? We should set INSN_PRIORITY to insn_cost when and insn has - some forward deps but all of them are ignored by + /* ??? We should set INSN_PRIORITY to insn_sched_cost when and insn + has some forward deps but all of them are ignored by contributes_to_priority hook. At the moment we set priority of such insn to 0. */ - this_priority = insn_cost (insn); + this_priority = insn_sched_cost (insn); else { rtx_insn *prev_first, *twin; @@ -1683,7 +1683,7 @@ priority (rtx_insn *insn) { gcc_assert (this_priority == -1); - this_priority = insn_cost (insn); + this_priority = insn_sched_cost (insn); } INSN_PRIORITY (insn) = this_priority; diff --git a/gcc/sched-int.h b/gcc/sched-int.h index 624d892..2af8f9f 100644 --- a/gcc/sched-int.h +++ b/gcc/sched-int.h @@ -1403,7 +1403,7 @@ extern void get_ebb_head_tail (basic_block, basic_block, rtx_insn **, rtx_insn **); extern int no_real_insns_p (const rtx_insn *, const rtx_insn *); -extern int insn_cost (rtx_insn *); +extern int insn_sched_cost (rtx_insn *); extern int dep_cost_1 (dep_t, dw_t); extern int dep_cost (dep_t); extern int set_priorities (rtx_insn *, rtx_insn *); diff --git a/gcc/sched-rgn.c b/gcc/sched-rgn.c index 492094e..ba5b47c 100644 --- a/gcc/sched-rgn.c +++ b/gcc/sched-rgn.c @@ -2837,8 +2837,8 @@ void debug_dependencies (rtx_insn *head, rtx_insn *tail) : INSN_PRIORITY (insn)) : INSN_PRIORITY (insn)), (sel_sched_p () ? (sched_emulate_haifa_p ? -1 - : insn_cost (insn)) - : insn_cost (insn))); + : insn_sched_cost (insn)) + : insn_sched_cost (insn))); if (recog_memoized (insn) < 0) fprintf (sched_dump, "nothing"); diff --git a/gcc/sel-sched-ir.c b/gcc/sel-sched-ir.c index fa88259..c0e835f 100644 --- a/gcc/sel-sched-ir.c +++ b/gcc/sel-sched-ir.c @@ -1324,7 +1324,7 @@ sel_insn_rtx_cost (rtx_insn *insn) } /* Return the cost of the VI. - !!! FIXME: Unify with haifa-sched.c: insn_cost (). */ + !!! FIXME: Unify with haifa-sched.c: insn_sched_cost (). */ int sel_vinsn_cost (vinsn_t vi) {