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: "juzhe.zhong@rivai.ai" X-Patchwork-Id: 155873 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:612c:2010:b0:403:3b70:6f57 with SMTP id fe16csp905650vqb; Fri, 20 Oct 2023 01:26:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEPUAXLGmBcOxat+HsmKCA+B+3pA7ZeWF1yDYl1bjMiC+oWCK7atdoWU2P/RmhM6tl039ma X-Received: by 2002:ac8:5896:0:b0:418:a14:9c30 with SMTP id t22-20020ac85896000000b004180a149c30mr1045091qta.9.1697790413802; Fri, 20 Oct 2023 01:26:53 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1697790413; cv=pass; d=google.com; s=arc-20160816; b=Cwb06M+B/xw2ztcRmSTin/5ZfrnSF4dodkl24rGyRbvFfmWIu0DwDe/xWhVbWZQA3Z EgPAphZvlEBccRn+QtL9TzX62L4vRh3uEINw53YzX+MdYPpnS3ytmbV4fMRr1qS0RKPU Ao04OazJ6sgbG1KhleqNx7PsXAJa15/urvTPDXKRZQ/5wDfMbmB2TPljtvd3w0FkS/Kt X3Sjq+ClTv8di2BapoakU0fSSl0e69Rh0dU3AAF6ojDUZQ5k5XxAjgrhA5yQfYNUlX2p uXgEW1Trw2psOon9+9+j9tpA/Nz/sk8sIKoX0o7y6LUkteqGwmaaVdNhoWjBPzdQq0/q GRWw== 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:feedback-id :content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:arc-filter:dmarc-filter:delivered-to; bh=vYBfQoczf116dsLNPhDyHsxe0J9xO2Nifr0JawNhPZw=; fh=12MRPJmZ1mgDpHqWoogMKqnaGRGM2b7lcuJroqfjJiw=; b=tGlL3qB1oYyzoCJlETGWtw1xf/ZsnTUP6gQFYzJeU9P7vBrFsKo2e4NRrvd3pGg4Zu 7CB+fNxEIzivlC2u7oe15whEe16DeTw/0qNTjzJaSLk2m1dTkWP/W6woIk9ZES1xNRAc 1ZMPx1loAVaDLg5MY0lQVRgrvpSJ/fTDJqEMhuMLjxuPEhfxTZKJ885d5EhNoUjv3LiP Wh9EgfbmDrVZKQFN8pr5l5txk7vKHlc7WA/7YoomGAecSY53BQm6BjJCWZvia2fkJgWv DiguVSDeTGVEcu1vKUHT+e74YGekdQd+HkAR4GeXetQw9JdlIpWhbXCVDW4Hzud6GIxe H+fw== 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" Received: from server2.sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id w31-20020a05622a191f00b0041957764bd3si953595qtc.734.2023.10.20.01.26.53 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 20 Oct 2023 01:26:53 -0700 (PDT) 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" Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 83F473858C52 for ; Fri, 20 Oct 2023 08:26:53 +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+ouuuleilei=gmail.com@gcc.gnu.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1780262280799500009 X-GMAIL-MSGID: 1780262280799500009 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 ())