From patchwork Fri Jul 17 00:21:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Segher Boessenkool X-Patchwork-Id: 1330639 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4B7BdQ00Blz9sRN for ; Fri, 17 Jul 2020 10:22:00 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B6A81387085D; Fri, 17 Jul 2020 00:21:56 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from gcc1-power7.osuosl.org (gcc1-power7.osuosl.org [140.211.15.137]) by sourceware.org (Postfix) with ESMTP id 085523857C64 for ; Fri, 17 Jul 2020 00:21:54 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 085523857C64 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=none smtp.mailfrom=segher@gcc1-power7.osuosl.org Received: by gcc1-power7.osuosl.org (Postfix, from userid 10019) id 37477124011A; Fri, 17 Jul 2020 00:21:53 +0000 (UTC) From: Segher Boessenkool To: gcc-patches@gcc.gnu.org Subject: [PATCH] combine: Use single_set for is_just_move Date: Fri, 17 Jul 2020 00:21:47 +0000 Message-Id: <84c5396d4bdbf9f1d628c77db4421808f9a9dcb6.1594943621.git.segher@kernel.crashing.org> X-Mailer: git-send-email 1.8.3.1 X-Spam-Status: No, score=-13.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, SPF_HELO_NONE, SPF_NONE, 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: , Cc: Hans-Peter Nilsson , Segher Boessenkool Errors-To: gcc-patches-bounces@gcc.gnu.org Sender: "Gcc-patches" Since we now only call is_just_move on the original instructions, we always have an rtx_insn* (not just a pattern), so we can use single_set on it. This makes no detectable difference at all on all thirty Linux targets I test, but it does help cris, and it is simpler, cleaner code anyway. Tested on powerpc64-linux {-m32,-m64}. Committed. Segher 2020-07-16 Hans-Peter Nilsson Segher Boessenkool PR target/93372 * combine.c (is_just_move): Take an rtx_insn* as argument. Use single_set on it. --- gcc/combine.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gcc/combine.c b/gcc/combine.c index b044f29..4fee114 100644 --- a/gcc/combine.c +++ b/gcc/combine.c @@ -2624,15 +2624,16 @@ can_split_parallel_of_n_reg_sets (rtx_insn *insn, int n) return true; } -/* Return whether X is just a single set, with the source +/* Return whether X is just a single_set, with the source a general_operand. */ static bool -is_just_move (rtx x) +is_just_move (rtx_insn *x) { - if (INSN_P (x)) - x = PATTERN (x); + rtx set = single_set (x); + if (!set) + return false; - return (GET_CODE (x) == SET && general_operand (SET_SRC (x), VOIDmode)); + return general_operand (SET_SRC (set), VOIDmode); } /* Callback function to count autoincs. */