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: "juzhe.zhong@rivai.ai" X-Patchwork-Id: 41208 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2423083wrt; Mon, 9 Jan 2023 14:51:52 -0800 (PST) X-Google-Smtp-Source: AMrXdXs48+H8LUlFRSMvEb2iTVUQgt/iT0dNk8mZeEGUIRn2ajk88FQhcihoi00vQfwHyueWBPo1 X-Received: by 2002:a17:907:9a98:b0:7c1:d4c:f08c with SMTP id km24-20020a1709079a9800b007c10d4cf08cmr58292457ejc.4.1673304712154; Mon, 09 Jan 2023 14:51:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673304712; cv=none; d=google.com; s=arc-20160816; b=zcWQMgRD2oRr9d1iWODjmWzFk2S9bBQ9D/gRrjziBx2IKxF1xpNRWVS7IZEwoI1DC/ FSq78V3slKn3h88X74gqZz67Sq4vR6P8JZAUcSqLV4qIJ6pJG1GT1HWfH5dT+63bor7P 828h9c1BoSYSlJyp8nivfhaN2azTKuScCDuKS38AEK4sB2T/QyZLIyANpwf+LBLbQ4UO T8gknBH2HpytfPwqMmqmQn3ecgRMo8+1HyFjBUj/F9WoHscGnYX2xMKBI6vnQkqhW8bV 1+gObAFv10xA6KUFhgQH+bigYpbnk5HKVw4xEH2rd+qCMCwEmzR30y6SUU/CNLIPbEXJ CoYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender: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:dmarc-filter:delivered-to; bh=1qYKSgWnnPVpdLD0q00pEFe8cCssJGkpirunSWl3SR8=; b=lPQAh8Eggzhr9ClCpWgU+lVltoN4TqMQzuEWitE08ZBoPNIIB22i6AjL5WWB1v87UG ZEWDNWBB3r1zNmfiS54GQ2pBA31F9U+rf0itfVTFJJ1lHTYupIzLAUPwVXv66OR9ARF7 zG/YJz/uo+d+aiex59viJadC3mpF19MfXGVyNIut2ktoyQm9SuenXCmvzkNhW0De5bXe HVnREPw6oFYtJj+D6pZjmUj74ICMmWmvNCXAcaljPK5ps2E6sddXl3pEnV5cLrcPO4lm T0n4K5cc1oxUE5fOaYm32pjSO4kzaZFWGSRViqwEfmKtPxOI0TXlrG8jh8PeJ0OHZCsl vt/A== ARC-Authentication-Results: i=1; mx.google.com; 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 sourceware.org (ip-8-43-85-97.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id xd8-20020a170907078800b007c11805a849si9826804ejb.341.2023.01.09.14.51.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Jan 2023 14:51:52 -0800 (PST) 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; 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 39ACE3858C27 for ; Mon, 9 Jan 2023 22:51:50 +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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1754587161636697614?= X-GMAIL-MSGID: =?utf-8?q?1754587161636697614?= 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;