From patchwork Wed Dec 28 05:19:47 2022 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: 1719752 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=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from 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 (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Nhfwp494kz23dZ for ; Wed, 28 Dec 2022 16:20:08 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 862D8385842D for ; Wed, 28 Dec 2022 05:20:06 +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 BD7D83858D37 for ; Wed, 28 Dec 2022 05:19:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org BD7D83858D37 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=rivai.ai Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=rivai.ai X-QQ-mid: bizesmtp63t1672204789togeoeyh Received: from rios-cad5.localdomain ( [58.60.1.11]) by bizesmtp.qq.com (ESMTP) with id ; Wed, 28 Dec 2022 13:19:48 +0800 (CST) X-QQ-SSF: 01400000000000E0L000000A0000000 X-QQ-FEAT: QityeSR92A3fV4HNM4zwqxvWhas94KpFxR6IxArU6jnziqgNsOJ/BsD6ChLK8 FWrqSGx+dkfsJqVc5s9tFh/nf5jE9qvM9ZevNnAX+Lev50fYhJkY103kON/ayRPpNeo4u+A Y3gnO1btXE6lcUWLCv+lAKUvyfbMZJv8Ror/dYW/Qvo5m6G1HTORR1MepXsjeEQfhv6WHfl IoJXzQUjACaHT0fGaoj73dqun75jaCIm6d7o2+EWRf7MhZc5og2Oy4N5O1yoXOYfLkkvdOY rPFoM344S9MW0HS7XNeI1jk9PNWNV8e1lU5Eusb98cRNi6NjWipW3QfyAeVTho9kRdk4WD1 9d/mo2ca2+DaKCiqvk0DrqOAMqPlsrvKtI/ck9zfRea/42KRQOuAmWE9q+49puqfBChA8ik X-QQ-GoodBg: 2 From: juzhe.zhong@rivai.ai To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, palmer@dabbelt.com, jeffreyalaw@gmail.com, Ju-Zhe Zhong Subject: [PATCH] RISC-V: Change form of iterating blocks Date: Wed, 28 Dec 2022 13:19:47 +0800 Message-Id: <20221228051947.219604-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:qybglogicsvr:qybglogicsvr7 X-Spam-Status: No, score=-12.5 required=5.0 tests=BAYES_00, GIT_PATCH_0, KAM_DMARC_STATUS, 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.29 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 Sender: "Gcc-patches" From: Ju-Zhe Zhong gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (pass_vsetvl::compute_global_backward_infos): Change iterator form. (pass_vsetvl::prune_expressions): Change iterator form. --- gcc/config/riscv/riscv-vsetvl.cc | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc index 0d66765e09c..ce1e9e3609f 100644 --- a/gcc/config/riscv/riscv-vsetvl.cc +++ b/gcc/config/riscv/riscv-vsetvl.cc @@ -1962,10 +1962,11 @@ pass_vsetvl::compute_global_backward_infos (void) if (dump_file) { fprintf (dump_file, "\n\nDirty blocks list: "); - for (const bb_info *bb : crtl->ssa->bbs ()) - if (m_vector_manager->vector_block_infos[bb->index ()] + basic_block cfg_bb; + FOR_EACH_BB_FN (cfg_bb, cfun) + if (m_vector_manager->vector_block_infos[cfg_bb->index] .reaching_out.dirty_p ()) - fprintf (dump_file, "%d ", bb->index ()); + fprintf (dump_file, "%d ", cfg_bb->index); fprintf (dump_file, "\n\n"); } } @@ -1974,16 +1975,17 @@ pass_vsetvl::compute_global_backward_infos (void) void pass_vsetvl::prune_expressions (void) { - for (const bb_info *bb : crtl->ssa->bbs ()) + basic_block cfg_bb; + FOR_EACH_BB_FN (cfg_bb, cfun) { - if (m_vector_manager->vector_block_infos[bb->index ()] + if (m_vector_manager->vector_block_infos[cfg_bb->index] .local_dem.valid_or_dirty_p ()) m_vector_manager->create_expr ( - m_vector_manager->vector_block_infos[bb->index ()].local_dem); - if (m_vector_manager->vector_block_infos[bb->index ()] + m_vector_manager->vector_block_infos[cfg_bb->index].local_dem); + if (m_vector_manager->vector_block_infos[cfg_bb->index] .reaching_out.valid_or_dirty_p ()) m_vector_manager->create_expr ( - m_vector_manager->vector_block_infos[bb->index ()].reaching_out); + m_vector_manager->vector_block_infos[cfg_bb->index].reaching_out); } if (dump_file)