From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by sourceware.org (Postfix) with ESMTP id 2D3313851C3A for ; Fri, 13 Nov 2020 08:12:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 2D3313851C3A 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 DFE46142F for ; Fri, 13 Nov 2020 00:12:23 -0800 (PST) Received: from localhost (e121540-lin.manchester.arm.com [10.32.98.126]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 889D73F718 for ; Fri, 13 Nov 2020 00:12:23 -0800 (PST) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [02/23] rtlanal: Remove noop_move_p REG_EQUAL condition References: Date: Fri, 13 Nov 2020 08:12:21 +0000 In-Reply-To: (Richard Sandiford's message of "Fri, 13 Nov 2020 08:10:54 +0000") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-12.6 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 13 Nov 2020 08:12:25 -0000 noop_move_p currently keeps any instruction that has a REG_EQUAL note, on the basis that the equality might be useful in future. But this creates a perverse incentive not to add potentially-useful REG_EQUAL notes, in case they prevent an instruction from later being removed as dead. The condition originates from flow.c:life_analysis_1 and predates the changes tracked by the current repository (1992). It probably made sense when most optimisations were done on RTL rather than FE trees, but it seems counterproductive now. gcc/ * rtlanal.c (noop_move_p): Don't check for REG_EQUAL notes. --- gcc/rtlanal.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/gcc/rtlanal.c b/gcc/rtlanal.c index 01130a10783..6f521503c39 100644 --- a/gcc/rtlanal.c +++ b/gcc/rtlanal.c @@ -1668,10 +1668,6 @@ noop_move_p (const rtx_insn *insn) if (INSN_CODE (insn) == NOOP_MOVE_INSN_CODE) return 1; - /* Insns carrying these notes are useful later on. */ - if (find_reg_note (insn, REG_EQUAL, NULL_RTX)) - return 0; - /* Check the code to be executed for COND_EXEC. */ if (GET_CODE (pat) == COND_EXEC) pat = COND_EXEC_CODE (pat); -- 2.17.1