From patchwork Sun Nov 5 18:31:04 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 161751 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:8f47:0:b0:403:3b70:6f57 with SMTP id j7csp2255676vqu; Sun, 5 Nov 2023 10:31:29 -0800 (PST) X-Google-Smtp-Source: AGHT+IG4wOuWzmbyEHL/ecgapuJBP7daxAiyou+JnI1o0fsvKWPumbMrdauHvYI5qPaWkcMDc17Z X-Received: by 2002:a05:6830:43a7:b0:6d3:264e:ba91 with SMTP id s39-20020a05683043a700b006d3264eba91mr10500281otv.36.1699209089267; Sun, 05 Nov 2023 10:31:29 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1699209089; cv=pass; d=google.com; s=arc-20160816; b=kYBbGN5/mDPOKNaCpG8zh9eXAxIfvyLze//FEcgziL3b3vg8QZyWL+Au4Sg8P5LKA2 U24Bw+oDzlqiIvRMHf8EXGaTROKd3SrzkO1vYZWMFZydy9UUCspYKOCsedsSOZKSm+e/ Hd+noOnez8Q+Y0Bt2Nu6DwQsaL8n7rRhDAIwAkokThl3ot39gvkr13bJYA834xGq0CM9 F3g/Y1QNyPAPCMBT8SuEsp3fW4psVUQVQzavbVsGsLYfpogYMBrbYIar+X4unpl4b7L3 R6lfNEWHqhiGkFF1XjDukop4EHTFnp9wz19PLgCVvP1lvLbn3SIzl78Swolg/pY57EXK lI4Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:mime-version:user-agent :message-id:date:subject:mail-followup-to:to:from:arc-filter :dmarc-filter:delivered-to; bh=pFv20yekfZaGiieVnp0K0xNoNh75xS/NvpHf23RZGhI=; fh=hPrbWPhweUx4V0GV9uXJqbyAzg2ABmTz7kczrAQqMmM=; b=bfbpCWzvvDnM2padhUuWnVJvSYV4HR6iM6Ow076pf8s4+Y7v4MvWFBiwalHwkvMCkq WVNairirPPXaAHJJVNoX2LxCB+xwX/w37mdgBI1xPF8hkggVubKdIFj3XFPKQMIDgZeb FxxQZtAwdUX0mI6yMJN1t9t417MzZMMuK598ZaFG7qApaM6XOtsRiwHvI54LO3lIN2ES lrJQUL/1H0KcENzjoZVN3BbpuMYpe6STPR/PQGAF/W7mTk9PzMrFFYmPoJbE7IiEctTQ m5iFOv11yxjjadWxqSycxaTdPyBcdvt0nae5UwROjop5FJjzrSaMhcP9F19DV4lrgXtv Y6RQ== ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id o18-20020ac87c52000000b00403bfdaa607si4590797qtv.777.2023.11.05.10.31.29 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 05 Nov 2023 10:31:29 -0800 (PST) Received-SPF: pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) client-ip=8.43.85.97; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org designates 8.43.85.97 as permitted sender) smtp.mailfrom="gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 0BCC4385701B for ; Sun, 5 Nov 2023 18:31:29 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 667DD3858CDB for ; Sun, 5 Nov 2023 18:31:06 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 667DD3858CDB Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=arm.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 667DD3858CDB Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=217.140.110.172 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699209067; cv=none; b=InT+ZVapcIV8+K1NIo+LsPM20jP9sim69J87awWUntsP+TbpK69fnbS2pJrjB124t/uGR/figwJzZOsIDSNquTOx3dAYeHBMk/kdRROPG2cfhMJbpFPEKSrEj4WFTw42s2cdTT4tR3wXi7QT2MqeLhRf+OsFoqhlSTid/YI69Cw= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699209067; c=relaxed/simple; bh=wThApb+hKbDpoVQzyMv+bjYF6H7d7IFI4+qVaoPoF/4=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=k5lcc3+LTUqvfHIIjD5ukb9FmgYCtoYlET2KiSQT5pNAfN9quYfmCbD6G9WOxay39DtjmAtQSjLTeTU86ozaZL0UonyDrWaZk8+PSV7l2TaNGVPy/JnVrvi8E6TBYzZqGfVHHycoSP5gfLlRqTTTczEEDAM2xVc81Un1sI1jQm8= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id E4A72C15 for ; Sun, 5 Nov 2023 10:31:49 -0800 (PST) Received: from localhost (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id BC7F83F703 for ; Sun, 5 Nov 2023 10:31:05 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [pushed] mode-switching: Remove unused bbnum field Date: Sun, 05 Nov 2023 18:31:04 +0000 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 X-Spam-Status: No, score=-23.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_NONE, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, TXREP, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1781749870266262420 X-GMAIL-MSGID: 1781749870266262420 seginfo had an unused bbnum field, presumably dating from before BB information was attached directly to insns. Pushed as obvious after testing on aarch64-linux-gnu & x86_64-linux-gnu. Richard gcc/ * mode-switching.cc: Remove unused forward references. (seginfo): Remove bbnum. (new_seginfo): Remove associated argument. (optimize_mode_switching): Update calls accordingly. --- gcc/mode-switching.cc | 18 +++++------------- 1 file changed, 5 insertions(+), 13 deletions(-) diff --git a/gcc/mode-switching.cc b/gcc/mode-switching.cc index f483c831c35..c3e4d24de9b 100644 --- a/gcc/mode-switching.cc +++ b/gcc/mode-switching.cc @@ -65,13 +65,11 @@ along with GCC; see the file COPYING3. If not see MODE is the mode this insn must be executed in. INSN_PTR is the insn to be executed (may be the note that marks the beginning of a basic block). - BBNUM is the flow graph basic block this insn occurs in. NEXT is the next insn in the same basic block. */ struct seginfo { int mode; rtx_insn *insn_ptr; - int bbnum; struct seginfo *next; HARD_REG_SET regs_live; }; @@ -84,11 +82,6 @@ struct bb_info int mode_in; }; -static struct seginfo * new_seginfo (int, rtx_insn *, int, HARD_REG_SET); -static void add_seginfo (struct bb_info *, struct seginfo *); -static void reg_dies (rtx, HARD_REG_SET *); -static void reg_becomes_live (rtx, const_rtx, void *); - /* Clear ode I from entity J in bitmap B. */ #define clear_mode_bit(b, j, i) \ bitmap_clear_bit (b, (j * max_num_modes) + i) @@ -148,13 +141,13 @@ commit_mode_sets (struct edge_list *edge_list, int e, struct bb_info *info) } /* Allocate a new BBINFO structure, initialized with the MODE, INSN, - and basic block BB parameters. + and REGS_LIVE parameters. INSN may not be a NOTE_INSN_BASIC_BLOCK, unless it is an empty basic block; that allows us later to insert instructions in a FIFO-like manner. */ static struct seginfo * -new_seginfo (int mode, rtx_insn *insn, int bb, HARD_REG_SET regs_live) +new_seginfo (int mode, rtx_insn *insn, const HARD_REG_SET ®s_live) { struct seginfo *ptr; @@ -163,7 +156,6 @@ new_seginfo (int mode, rtx_insn *insn, int bb, HARD_REG_SET regs_live) ptr = XNEW (struct seginfo); ptr->mode = mode; ptr->insn_ptr = insn; - ptr->bbnum = bb; ptr->next = NULL; ptr->regs_live = regs_live; return ptr; @@ -605,7 +597,7 @@ optimize_mode_switching (void) gcc_assert (NOTE_INSN_BASIC_BLOCK_P (ins_pos)); if (ins_pos != BB_END (bb)) ins_pos = NEXT_INSN (ins_pos); - ptr = new_seginfo (no_mode, ins_pos, bb->index, live_now); + ptr = new_seginfo (no_mode, ins_pos, live_now); add_seginfo (info + bb->index, ptr); for (i = 0; i < no_mode; i++) clear_mode_bit (transp[bb->index], j, i); @@ -623,7 +615,7 @@ optimize_mode_switching (void) { any_set_required = true; last_mode = mode; - ptr = new_seginfo (mode, insn, bb->index, live_now); + ptr = new_seginfo (mode, insn, live_now); add_seginfo (info + bb->index, ptr); for (i = 0; i < no_mode; i++) clear_mode_bit (transp[bb->index], j, i); @@ -652,7 +644,7 @@ optimize_mode_switching (void) mark the block as nontransparent. */ if (!any_set_required) { - ptr = new_seginfo (no_mode, BB_END (bb), bb->index, live_now); + ptr = new_seginfo (no_mode, BB_END (bb), live_now); add_seginfo (info + bb->index, ptr); if (last_mode != no_mode) for (i = 0; i < no_mode; i++)