From patchwork Mon Jan 9 22:50:35 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: 1723732 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=8.43.85.97; helo=sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Received: from sourceware.org (server2.sourceware.org [8.43.85.97]) (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 4NrThV1nh6z23fY for ; Tue, 10 Jan 2023 09:51:38 +1100 (AEDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 8FDE138582BE for ; Mon, 9 Jan 2023 22:51:35 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbgeu1.qq.com (smtpbgeu1.qq.com [52.59.177.22]) by sourceware.org (Postfix) with ESMTPS id 141573858D38 for ; Mon, 9 Jan 2023 22:51:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 141573858D38 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: bizesmtp78t1673304637tnzoh7aq Received: from server1.localdomain ( [58.60.1.22]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 10 Jan 2023 06:50:36 +0800 (CST) X-QQ-SSF: 01400000002000E0L000B00A0000000 X-QQ-FEAT: eTp2eCgHrZlB4JK1IfAWc1mfw1vKhaebPucnGvU/ZAOUaVVgKAYRTOIU8FeNz Y/Aj5WSSwS9noiSjhYavMc3jcfQiS8B+5g8sW6Na103UobXgNa61g/zdfzKuEQZZK4gXwRI VCrM84maW9IfIFCm974qqiVIqsqHWeGWkc1JQk+bJdr1RwJT5QbQ1oz3uuU53ykGtkJDvr8 wk1KbcCUHvcx5ZFEqbY+ZBKdNO3SSQBcSNE+g9079LHfno0xHS/UpFLZ+6UZEhcABtS4Qnj Qp7tkYhwXGX2955TcilB5efmxIby/8KQxfEwL3k03P6im8Xagb0oRNuLCwyFA0BlrcyENJ8 frrwm7rs4Iiq4NWgiJH39bqwYKZ50uZ+MlqiqaOw0JsCdaLym4hNPQ26Pcej+Zn1HQBg63h 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: Avoid redundant flow in backward fusion Date: Tue, 10 Jan 2023 06:50:35 +0800 Message-Id: <20230109225035.149190-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_PASS, TXREP, T_SPF_HELO_TEMPERROR 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::backward_demand_fusion): Add pre-check to avoid redundant flow. --- gcc/config/riscv/riscv-vsetvl.cc | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc index 0ca1c51d121..a972c49561a 100644 --- a/gcc/config/riscv/riscv-vsetvl.cc +++ b/gcc/config/riscv/riscv-vsetvl.cc @@ -2020,6 +2020,8 @@ pass_vsetvl::backward_demand_fusion (void) if (!backward_propagate_worthwhile_p (cfg_bb, curr_block_info)) continue; + + if (cfg_bb == EXIT_BLOCK_PTR_FOR_FN (cfun)) continue; edge e;