From patchwork Fri Oct 20 08:25:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?6ZKf5bGF5ZOy?= X-Patchwork-Id: 1852338 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 4SBd3C48ZBz23jM for ; Fri, 20 Oct 2023 19:26:30 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D9CFB385843A for ; Fri, 20 Oct 2023 08:26:28 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbgau2.qq.com (smtpbgau2.qq.com [54.206.34.216]) by sourceware.org (Postfix) with ESMTPS id B61213858D1E for ; Fri, 20 Oct 2023 08:26:08 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B61213858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivai.ai Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivai.ai ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B61213858D1E Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=54.206.34.216 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697790374; cv=none; b=os6Mul3p3uRyNvA+m7N/9QQiZ4CT4PeFzgZZMAQUennIfrcxvJsn3Djp1E9bPSygdM2KPAeg2DyRAY1Fh6Gn3+6AhQf2eX5x//N1W9LZpRLcOXbkyPkQG+etd9zpyOU1xwGKOxhjpYsqirLdE1SbBeo1TFlmoTeU/mrzTrh6iIM= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1697790374; c=relaxed/simple; bh=zZ+PABrVYZgi2I4YSLbfjulUx4PfOMnKfx2MxZDMw40=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=V0Bv4R0WPOoHyHuCPDZrEb9qsOaT3D01kpIvOnBsusO3IIP91KrcmiAk9L8Z1aC6qZAt7R9Ukejbtf2W5ecNF8JHzjh9tnL9/7YQiqz9rZ1YUjznyN0gUZU8ympMtZw+hguO7qBb/LE9OyCutV2XnNXQMKdKuIWTQoZjMPKQeMk= ARC-Authentication-Results: i=1; server2.sourceware.org X-QQ-mid: bizesmtp63t1697790360t5u5vfsf Received: from rios-cad122.hadoop.rioslab.org ( [58.60.1.26]) by bizesmtp.qq.com (ESMTP) with id ; Fri, 20 Oct 2023 16:25:58 +0800 (CST) X-QQ-SSF: 01400000000000G0V000000A0000000 X-QQ-FEAT: +ynUkgUhZJnltxkF7xAwHkI2g9PPpCAjSJefXbjuMKZpf/ivPicP1soMTDcdh WvufJIoRr6k8/B0da8QDUDTtASbQCnlwF5UL3tZB6EkHA9dF2LSbzJjR1VwXLPl/gLThglb LtPIZkL22vhjoRBT78rC9MooxuWR/GCm3Y6yCrNXTDRHx09ZSvNGp4eUJfXdgIfY4d42WcJ PfvoRoM7XkF9fWZZclaQqvBvb7HQQf0radlmhm3wlnAWZUg9yIT/DjJ9zvpEC7przOEX+0q J+QhN6k/kYoKWbeBoZPH+yjbopX43tNJuTL+F8i+IPqa12W4QoPu4tIdCKQuLmAlC6zwlUA belLLiZwA7nOnK3ThKzsNPn8Q54ozawPwHJSA/42gPwgCJV9ykTxpfMsw1ErdTjxk7Fa7nG X-QQ-GoodBg: 2 X-BIZMAIL-ID: 17629417193598383233 From: Juzhe-Zhong To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, kito.cheng@sifive.com, jeffreyalaw@gmail.com, rdapp.gcc@gmail.com, Juzhe-Zhong Subject: [PATCH] RISC-V: Rename some variables of vector_block_info[NFC] Date: Fri, 20 Oct 2023 16:25:57 +0800 Message-Id: <20231020082557.2104496-1-juzhe.zhong@rivai.ai> X-Mailer: git-send-email 2.36.3 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvrgz:qybglogicsvrgz7a-one-0 X-Spam-Status: No, score=-10.4 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP 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 1. Remove "m_" prefix as they are not private members. 2. Rename infos -> local_infos, info -> global_info to clarify their meaning. Pushed as it is obvious. gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (pre_vsetvl::fuse_local_vsetvl_info): Rename variables. (pre_vsetvl::pre_global_vsetvl_info): Ditto. (pre_vsetvl::emit_vsetvl): Ditto. --- gcc/config/riscv/riscv-vsetvl.cc | 57 ++++++++++++++++---------------- 1 file changed, 29 insertions(+), 28 deletions(-) diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc index e136351aee5..5f26a9ec96a 100644 --- a/gcc/config/riscv/riscv-vsetvl.cc +++ b/gcc/config/riscv/riscv-vsetvl.cc @@ -1281,55 +1281,56 @@ public: /* The static execute probability of the demand info. */ profile_probability probability; - auto_vec infos; - vsetvl_info m_info; - bb_info *m_bb; + auto_vec local_infos; + vsetvl_info global_info; + bb_info *bb; bool full_available; - vsetvl_block_info () : m_bb (nullptr), full_available (false) + vsetvl_block_info () : bb (nullptr), full_available (false) { - infos.safe_grow_cleared (0); - m_info.set_empty (); + local_infos.safe_grow_cleared (0); + global_info.set_empty (); } vsetvl_block_info (const vsetvl_block_info &other) - : probability (other.probability), infos (other.infos.copy ()), - m_info (other.m_info), m_bb (other.m_bb) + : probability (other.probability), local_infos (other.local_infos.copy ()), + global_info (other.global_info), bb (other.bb) {} vsetvl_info &get_entry_info () { gcc_assert (!empty_p ()); - return infos.is_empty () ? m_info : infos[0]; + return local_infos.is_empty () ? global_info : local_infos[0]; } vsetvl_info &get_exit_info () { gcc_assert (!empty_p ()); - return infos.is_empty () ? m_info : infos[infos.length () - 1]; + return local_infos.is_empty () ? global_info + : local_infos[local_infos.length () - 1]; } const vsetvl_info &get_entry_info () const { gcc_assert (!empty_p ()); - return infos.is_empty () ? m_info : infos[0]; + return local_infos.is_empty () ? global_info : local_infos[0]; } const vsetvl_info &get_exit_info () const { gcc_assert (!empty_p ()); - return infos.is_empty () ? m_info : infos[infos.length () - 1]; + return local_infos.is_empty () ? global_info + : local_infos[local_infos.length () - 1]; } - bool empty_p () const { return infos.is_empty () && !has_info (); } - bool has_info () const { return !m_info.empty_p (); } + bool empty_p () const { return local_infos.is_empty () && !has_info (); } + bool has_info () const { return !global_info.empty_p (); } void set_info (const vsetvl_info &info) { - gcc_assert (infos.is_empty ()); - m_info = info; - m_info.set_bb (m_bb); + gcc_assert (local_infos.is_empty ()); + global_info = info; + global_info.set_bb (bb); } - void set_empty_info () { m_info.set_empty (); } + void set_empty_info () { global_info.set_empty (); } }; - /* Demand system is the RVV-based VSETVL info analysis tools wrapper. It defines compatible rules for SEW/LMUL, POLICY and AVL. Also, it provides 3 iterfaces avaiable_p, compatible_p and @@ -2323,7 +2324,7 @@ public: block_info.get_entry_info ().dump (file, " "); fprintf (file, " Footer vsetvl info:"); block_info.get_exit_info ().dump (file, " "); - for (const auto &info : block_info.infos) + for (const auto &info : block_info.local_infos) { fprintf (file, " insn %d vsetvl info:", info.get_insn ()->uid ()); @@ -2740,7 +2741,7 @@ pre_vsetvl::fuse_local_vsetvl_info () for (bb_info *bb : crtl->ssa->bbs ()) { auto &block_info = get_block_info (bb); - block_info.m_bb = bb; + block_info.bb = bb; if (dump_file && (dump_flags & TDF_DETAILS)) { fprintf (dump_file, " Try fuse basic block %d\n", bb->index ()); @@ -2768,7 +2769,7 @@ pre_vsetvl::fuse_local_vsetvl_info () else if ((curr_info.unknown_p () && prev_info.valid_p ()) || (curr_info.valid_p () && prev_info.unknown_p ())) { - block_info.infos.safe_push (prev_info); + block_info.local_infos.safe_push (prev_info); prev_info = curr_info; } else if (curr_info.valid_p () && prev_info.valid_p ()) @@ -2825,14 +2826,14 @@ pre_vsetvl::fuse_local_vsetvl_info () fprintf (dump_file, " curr_info: "); curr_info.dump (dump_file, " "); } - block_info.infos.safe_push (prev_info); + block_info.local_infos.safe_push (prev_info); prev_info = curr_info; } } } if (prev_info.valid_p () || prev_info.unknown_p ()) - block_info.infos.safe_push (prev_info); + block_info.local_infos.safe_push (prev_info); } m_avl_regs = sbitmap_alloc (GP_REG_LAST + 1); @@ -3194,9 +3195,9 @@ pre_vsetvl::pre_global_vsetvl_info () vsetvl_info &curr_info = block_info.get_entry_info (); if (curr_info.delete_p ()) { - if (block_info.infos.is_empty ()) + if (block_info.local_infos.is_empty ()) continue; - curr_info = block_info.infos[0]; + curr_info = block_info.local_infos[0]; } if (curr_info.valid_p () && !curr_info.vl_use_by_non_rvv_insn_p () && preds_has_same_avl_p (curr_info)) @@ -3204,7 +3205,7 @@ pre_vsetvl::pre_global_vsetvl_info () vsetvl_info prev_info = vsetvl_info (); prev_info.set_empty (); - for (auto &curr_info : block_info.infos) + for (auto &curr_info : block_info.local_infos) { if (prev_info.valid_p () && curr_info.valid_p () && m_dem.avl_available_p (prev_info, curr_info)) @@ -3221,7 +3222,7 @@ pre_vsetvl::emit_vsetvl () for (const bb_info *bb : crtl->ssa->bbs ()) { - for (const auto &curr_info : get_block_info (bb).infos) + for (const auto &curr_info : get_block_info (bb).local_infos) { insn_info *insn = curr_info.get_insn (); if (curr_info.delete_p ())