From patchwork Mon Jan 9 22:47:26 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: 1723726 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 4NrTc729Wkz23gB for ; Tue, 10 Jan 2023 09:47:50 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id C4406385842A for ; Mon, 9 Jan 2023 22:47:47 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbgau1.qq.com (smtpbgau1.qq.com [54.206.16.166]) by sourceware.org (Postfix) with ESMTPS id 9FE523858D38 for ; Mon, 9 Jan 2023 22:47:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 9FE523858D38 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: bizesmtp85t1673304448tawhkyak Received: from server1.localdomain ( [58.60.1.22]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 10 Jan 2023 06:47:27 +0800 (CST) X-QQ-SSF: 01400000002000E0L000B00A0000000 X-QQ-FEAT: XsPFd+JRxYwkavmXdcDIh9M/D+p7jGKyJqnH2X+tcLT7X6hn40nAmZiLJAQAF Lm2O/G/EpnNbTMgtYP3VcLYjzC9dPqakG9FSzFUJlPstd2fmbFubGpm7CzQyeN5cMpCRVLe DKvont0Wu3Xg+q36PF/MdHJOjk/hGaHBG827nCzbdF72OERmU7XXNzaNIqKlQyo3lGyjbIR YYT1JoWjV+3GKzoxq3GsffVGUA8Wxg8C8ZN/A8a2Pi5pZaFtMaTGGfZ0idhLwd9kmVauPSp 5qoHRfAIf7RNzoeC4bfYEEbifGMTb2mjFwxmukrpJ8M59TRrRZh0glFqrgkIoPQueiMTqWv ipnHvjdi62oTKvBW8jKta45mRtYWB3vCqfAmtj1syqQ+mlnhHw1+4Xp4wuBSNZZVEfPqSUR X-QQ-GoodBg: 2 From: juzhe.zhong@rivai.ai To: gcc-patches@gcc.gnu.org Cc: kito.cheng@gmail.com, palmer@dabbelt.com, Ju-Zhe Zhong Subject: [PATCH] RISC-V: Refine codes in backward fusion Date: Tue, 10 Jan 2023 06:47:26 +0800 Message-Id: <20230109224726.148263-1-juzhe.zhong@rivai.ai> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 X-QQ-SENDSIZE: 520 Feedback-ID: bizesmtp:rivai.ai:qybglogicsvr:qybglogicsvr7 X-Spam-Status: No, score=-10.6 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.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 This NFC patch is preparing for the following patches. gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (pass_vsetvl::backward_demand_fusion): Refine codes. --- gcc/config/riscv/riscv-vsetvl.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc index 18c6f437db6..0ca1c51d121 100644 --- a/gcc/config/riscv/riscv-vsetvl.cc +++ b/gcc/config/riscv/riscv-vsetvl.cc @@ -2010,15 +2010,16 @@ pass_vsetvl::backward_demand_fusion (void) for (const bb_info *bb : crtl->ssa->reverse_bbs ()) { basic_block cfg_bb = bb->cfg_bb (); - const auto &prop - = m_vector_manager->vector_block_infos[cfg_bb->index].local_dem; + const auto &curr_block_info + = m_vector_manager->vector_block_infos[cfg_bb->index]; + const auto &prop = curr_block_info.local_dem; /* If there is nothing to propagate, just skip it. */ if (!prop.valid_or_dirty_p ()) continue; - if (!backward_propagate_worthwhile_p ( - cfg_bb, m_vector_manager->vector_block_infos[cfg_bb->index])) + if (!backward_propagate_worthwhile_p (cfg_bb, curr_block_info)) + continue; continue; edge e;