From patchwork Wed Aug 28 14:49:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Sandiford X-Patchwork-Id: 1977916 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces~incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Wv6l671RCz1yXd for ; Thu, 29 Aug 2024 00:49:54 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 62289385EC3A for ; Wed, 28 Aug 2024 14:49:52 +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 BF0F63858C66 for ; Wed, 28 Aug 2024 14:49:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BF0F63858C66 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 BF0F63858C66 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=1724856569; cv=none; b=wBNSfheIAAKT5ItnG4O5boZfrHcnduQjUCfszjQ2H5BYfeBixfJc2YCjnFhysdrHexvHkqpyw4ph7Bj6KWyS+GIKOczhMdUHZ/NgmxrA3UGSmzp3VnBJyLxmKey1+jJBzXfraeUuD2s8bHxqa/DVkTB10yFVOcXcko39DJsUbXg= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724856569; c=relaxed/simple; bh=fUqkhjK9O3mx8UyXd3SBr+vk6tvHOdvV9yEYhVsfwDQ=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=WtwzXFXefANcswG9WZ5HShEwpibmwLg50kCz/4oxW7SoL4+ek3deLlST2JkweBCSKBHtxcbpQ4V13iJIkEfO/VLNsnFvl8aQiUx0i51hGYKrMT1mD33KDciMBQvprlKl4c6VZEqpkDLczFi20glBg/ATtbrQsXH24wMDLJNAqBc= 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 C87FCDA7 for ; Wed, 28 Aug 2024 07:49:51 -0700 (PDT) Received: from localhost (e121540-lin.manchester.arm.com [10.32.110.72]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id EE3B03F73B for ; Wed, 28 Aug 2024 07:49:24 -0700 (PDT) From: Richard Sandiford To: gcc-patches@gcc.gnu.org Mail-Followup-To: gcc-patches@gcc.gnu.org, richard.sandiford@arm.com Subject: [PATCH] Rename gimple_asm_input_p to gimple_asm_basic_p Date: Wed, 28 Aug 2024 15:49:22 +0100 Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) MIME-Version: 1.0 X-Spam-Status: No, score=-18.8 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~incoming=patchwork.ozlabs.org@gcc.gnu.org Following on from the earlier tree rename, this patch renames gimple_asm_input_p to gimple_asm_basic_p, and similarly for related names. Tested on aarch64-linux-gnu. OK to install? Richard gcc/ * doc/gimple.texi (gimple_asm_basic_p): Document. (gimple_asm_set_basic): Likewise. * gimple.h (GF_ASM_INPUT): Rename to... (GF_ASM_BASIC): ...this. (gimple_asm_set_input): Rename to... (gimple_asm_set_basic): ...this. (gimple_asm_input_p): Rename to... (gimple_asm_basic_p): ...this. * cfgexpand.cc (expand_asm_stmt): Update after above renaming. * gimple.cc (gimple_asm_clobbers_memory_p): Likewise. * gimplify.cc (gimplify_asm_expr): Likewise. * ipa-icf-gimple.cc (func_checker::compare_gimple_asm): Likewise. * tree-cfg.cc (stmt_can_terminate_bb_p): Likewise. --- gcc/cfgexpand.cc | 2 +- gcc/doc/gimple.texi | 9 +++++++++ gcc/gimple.cc | 2 +- gcc/gimple.h | 19 ++++++++++--------- gcc/gimplify.cc | 2 +- gcc/ipa-icf-gimple.cc | 2 +- gcc/tree-cfg.cc | 2 +- 7 files changed, 24 insertions(+), 14 deletions(-) diff --git a/gcc/cfgexpand.cc b/gcc/cfgexpand.cc index 13f8c08d295..f32cf1b20c9 100644 --- a/gcc/cfgexpand.cc +++ b/gcc/cfgexpand.cc @@ -3121,7 +3121,7 @@ expand_asm_stmt (gasm *stmt) location_t locus = gimple_location (stmt); - if (gimple_asm_input_p (stmt)) + if (gimple_asm_basic_p (stmt)) { const char *s = gimple_asm_string (stmt); tree string = build_string (strlen (s), s); diff --git a/gcc/doc/gimple.texi b/gcc/doc/gimple.texi index 5f241b1c64f..d8aaca26049 100644 --- a/gcc/doc/gimple.texi +++ b/gcc/doc/gimple.texi @@ -1112,6 +1112,15 @@ Return the string representing the assembly instruction in @code{GIMPLE_ASM} @code{G}. @end deftypefn +@deftypefn {GIMPLE function} bool gimple_asm_basic_p (const gasm *g) +Return true if @code{G} is a basic asm rather than an extended asm. +@end deftypefn + +@deftypefn {GIMPLE function} void gimple_asm_set_basic (gasm *g, bool basic_p) +Mark asm statement @code{G} as a basic asm or an extended asm based on +@code{BASIC_P}. +@end deftypefn + @deftypefn {GIMPLE function} bool gimple_asm_volatile_p (const gasm *g) Return true if @code{G} is an asm statement marked volatile. @end deftypefn diff --git a/gcc/gimple.cc b/gcc/gimple.cc index a9f968cb038..6e28cf291e1 100644 --- a/gcc/gimple.cc +++ b/gcc/gimple.cc @@ -2944,7 +2944,7 @@ gimple_asm_clobbers_memory_p (const gasm *stmt) } /* Non-empty basic ASM implicitly clobbers memory. */ - if (gimple_asm_input_p (stmt) && strlen (gimple_asm_string (stmt)) != 0) + if (gimple_asm_basic_p (stmt) && strlen (gimple_asm_string (stmt)) != 0) return true; return false; diff --git a/gcc/gimple.h b/gcc/gimple.h index bd315ffc2dd..ee986eaf153 100644 --- a/gcc/gimple.h +++ b/gcc/gimple.h @@ -135,7 +135,7 @@ enum gimple_rhs_class Keep this list sorted. */ enum gf_mask { - GF_ASM_INPUT = 1 << 0, + GF_ASM_BASIC = 1 << 0, GF_ASM_VOLATILE = 1 << 1, GF_ASM_INLINE = 1 << 2, GF_CALL_FROM_THUNK = 1 << 0, @@ -4227,24 +4227,25 @@ gimple_asm_set_inline (gasm *asm_stmt, bool inline_p) } -/* If INPUT_P is true, mark asm ASM_STMT as an ASM_INPUT. */ +/* Mark whether asm ASM_STMT is a basic asm or an extended asm, based on + BASIC_P. */ inline void -gimple_asm_set_input (gasm *asm_stmt, bool input_p) +gimple_asm_set_basic (gasm *asm_stmt, bool basic_p) { - if (input_p) - asm_stmt->subcode |= GF_ASM_INPUT; + if (basic_p) + asm_stmt->subcode |= GF_ASM_BASIC; else - asm_stmt->subcode &= ~GF_ASM_INPUT; + asm_stmt->subcode &= ~GF_ASM_BASIC; } -/* Return true if asm ASM_STMT is an ASM_INPUT. */ +/* Return true if asm ASM_STMT is a basic asm rather than an extended asm. */ inline bool -gimple_asm_input_p (const gasm *asm_stmt) +gimple_asm_basic_p (const gasm *asm_stmt) { - return (asm_stmt->subcode & GF_ASM_INPUT) != 0; + return (asm_stmt->subcode & GF_ASM_BASIC) != 0; } diff --git a/gcc/gimplify.cc b/gcc/gimplify.cc index 3c84cfce5f7..f87c22edf5c 100644 --- a/gcc/gimplify.cc +++ b/gcc/gimplify.cc @@ -7340,7 +7340,7 @@ gimplify_asm_expr (tree *expr_p, gimple_seq *pre_p, gimple_seq *post_p) ASM_VOLATILE_P (expr) || noutputs == 0 || labels); - gimple_asm_set_input (stmt, ASM_BASIC_P (expr)); + gimple_asm_set_basic (stmt, ASM_BASIC_P (expr)); gimple_asm_set_inline (stmt, ASM_INLINE_P (expr)); gimplify_seq_add_stmt (pre_p, stmt); diff --git a/gcc/ipa-icf-gimple.cc b/gcc/ipa-icf-gimple.cc index 4c3174b68b6..31f6cdbda06 100644 --- a/gcc/ipa-icf-gimple.cc +++ b/gcc/ipa-icf-gimple.cc @@ -986,7 +986,7 @@ func_checker::compare_gimple_asm (const gasm *g1, const gasm *g2) if (gimple_asm_volatile_p (g1) != gimple_asm_volatile_p (g2)) return false; - if (gimple_asm_input_p (g1) != gimple_asm_input_p (g2)) + if (gimple_asm_basic_p (g1) != gimple_asm_basic_p (g2)) return false; if (gimple_asm_inline_p (g1) != gimple_asm_inline_p (g2)) diff --git a/gcc/tree-cfg.cc b/gcc/tree-cfg.cc index e6fd1294b95..fcb488d8711 100644 --- a/gcc/tree-cfg.cc +++ b/gcc/tree-cfg.cc @@ -8887,7 +8887,7 @@ stmt_can_terminate_bb_p (gimple *t) } if (gasm *asm_stmt = dyn_cast (t)) - if (gimple_asm_volatile_p (asm_stmt) || gimple_asm_input_p (asm_stmt)) + if (gimple_asm_volatile_p (asm_stmt) || gimple_asm_basic_p (asm_stmt)) return true; return false;