From patchwork Mon Dec 19 23:13:54 2022 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: 34831 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:e747:0:0:0:0:0 with SMTP id c7csp2666521wrn; Mon, 19 Dec 2022 15:14:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXsNvOOdqxXoBFBIHWsqqYIlU6YhQ5CpLxRfpj4hoGrQGs/cFfugIipeE7bdAkT3qVSsXbtR X-Received: by 2002:a17:906:1797:b0:7ff:7876:9c5b with SMTP id t23-20020a170906179700b007ff78769c5bmr8744946eje.70.1671491673750; Mon, 19 Dec 2022 15:14:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671491673; cv=none; d=google.com; s=arc-20160816; b=gvY9PoJfm+ld0Rc6ydYTG6qAAzPZvFwps5ytAlqFnQgccJTWVFsw7tKbwCD9xUKdQI OjfPPyAdH8grWoJSr0zeJeXz7wDvys6dOY9Su4cbo+PhP9JBJriF3fjYXvVv7pq7AWQ2 VzW6nK+Z2adhPmYZUc6BpM4RlGmC9kNTM/w6WJl5GekJH9DQIv9WBCE4TZbnC6/QE92r cD9/W9Wwnx2qYcdBW40Xrs5PFslA38ThgkJcQ6MRnqdLIPycsrGh2qKwZtnoz4nblIXW IMjMqHLivh8srH21X3H/kGSmJYIemcdHXM1ie8jfxuYhW/BDwYYPRh0VPDTQ2CfGvKyX w9Dw== 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=gDzrjmDpIWERvgbyFGRipSAwRUKAntIh8tBUvd3ueq4=; b=Avpzq9iT56t0yUKfcsurNmjf8I2Fo41orskhueZ9USIJhL2GH9XZMFAYRhfIaY9Ur+ uH6iaPD1nTwph1pdYkBXPzLMvpIMZ8X/jX6RSbw5ZjZKpyacUh1Z4ceaIS+fCDelfHnn 1TxcJVB0RabS7aZiSlVZk6kstL2I43bCt1rY21G31ykgkGrMLYUwknaUHqBHVCN2DDyi ApMS4c4fafKZuGsgqLrgluhw+VlkbLhq+juvm2cuq2SKx+E/196jvmjBwcVGviPKsv9H X40+DI8ESGTWswaciJWqb+LpOScTRTivhg0PfnO4FfeCjbjVD0pMxvOwN6Wd3MfjQBIh APPQ== 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 (server2.sourceware.org. [8.43.85.97]) by mx.google.com with ESMTPS id mm8-20020a170906cc4800b007c15ca85481si653316ejb.812.2022.12.19.15.14.33 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Dec 2022 15:14:33 -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 81F553858C78 for ; Mon, 19 Dec 2022 23:14:32 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from smtpbguseast2.qq.com (smtpbguseast2.qq.com [54.204.34.130]) by sourceware.org (Postfix) with ESMTPS id 23CE93858D1E for ; Mon, 19 Dec 2022 23:14:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 23CE93858D1E 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: bizesmtp91t1671491637t2s6qd48 Received: from server1.localdomain ( [58.60.1.22]) by bizesmtp.qq.com (ESMTP) with id ; Tue, 20 Dec 2022 07:13:56 +0800 (CST) X-QQ-SSF: 01400000002000E0K000B00A0000000 X-QQ-FEAT: yjKCIP+3BE2iwaxkD0SrnbxCKxGvIEm7wlDLs6vFD++31JTHBe02PD/AAo3EF MQo9ZS60I5z7h+m6ARorudz8DHgU5mYFhBc1hAJ4vwaTL2Of6iseg5mMs9otIFzAKyMSwjb bLE41q1cGSLhzT4Qdy4jhrORjRog9tk/oApAdkr2PaUtTYfQ8mjwFbvHp2sMP6hhjOP1jGx G4IgyfgLF+gPa5kT04P+shHeVZ6pjyCSnB9crIEVfZBfKLraPzNCWx+KtJMB1OaKaEhxsiC NgDZUoZxCqasxpoZD35HYz/5XKl4Rq+4dqEPl993Sfoai/Oy9VtGndqomJemvwUkkG/3peN OGiD0GK36QnvqsWSiXabOCfW+bWfgfZ6T8XkNOuOOzfyFvbr3cjYodoEzg9aw== 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: Fix incorrect annotation Date: Tue, 20 Dec 2022 07:13:54 +0800 Message-Id: <20221219231354.135626-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.8 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+ouuuleilei=gmail.com@gcc.gnu.org Sender: "Gcc-patches" X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1752686053548515445?= X-GMAIL-MSGID: =?utf-8?q?1752686053548515445?= From: Ju-Zhe Zhong gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (anticipatable_occurrence_p): Fix incorrect annotations. (available_occurrence_p): Ditto. (backward_propagate_worthwhile_p): Ditto. (can_backward_propagate_p): Ditto. --- gcc/config/riscv/riscv-vsetvl.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc index 0c2ff630e96..72f1e4059ab 100644 --- a/gcc/config/riscv/riscv-vsetvl.cc +++ b/gcc/config/riscv/riscv-vsetvl.cc @@ -186,7 +186,7 @@ anticipatable_occurrence_p (const insn_info *insn, const vector_insn_info dem) /* The only possible operand we care of VSETVL is AVL. */ if (dem.has_avl_reg ()) { - /* The operands shoule not be modified in the basic block prior + /* The operands should not be modified in the basic block prior to the occurrence. */ if (!vlmax_avl_p (dem.get_avl ())) { @@ -223,7 +223,7 @@ available_occurrence_p (const insn_info *insn, const vector_insn_info dem) /* The only possible operand we care of VSETVL is AVL. */ if (dem.has_avl_reg ()) { - /* The operands shoule not be modified in the basic block prior + /* The operands should not be modified in the basic block prior to the occurrence. e.g. bb: @@ -284,7 +284,7 @@ backward_propagate_worthwhile_p (const basic_block cfg_bb, |_________| reaching_out Header is incompatible with reaching_out and the block is loop itself, - we don't backward propagete the local_dem since we can't avoid emit + we don't backward propagate the local_dem since we can't avoid emit vsetvl for the local_dem. */ edge e; edge_iterator ei; @@ -334,10 +334,10 @@ can_backward_propagate_p (const function_info *ssa, const basic_block cfg_bb, insn_info *insn = prop.get_insn (); /* TODO: We don't backward propagate the explict VSETVL here - since we will change vsetvl and vsetvlmax intrinsiscs into - no side effects which can be optimized into optimzal location - by GCC internal PASSes. We only need to support these backward - propagation if vsetvl instrinsics have side effects. */ + since we will change vsetvl and vsetvlmax intrinsics into + no side effects which can be optimized into optimal location + by GCC internal passes. We only need to support these backward + propagation if vsetvl intrinsics have side effects. */ if (vsetvl_insn_p (insn->rtl ())) return false; @@ -369,7 +369,7 @@ can_backward_propagate_p (const function_info *ssa, const basic_block cfg_bb, def_info *def = find_access (insn->uses (), REGNO (reg))->def (); /* If the definition is in the current block, we can't propagate it - acrocss blocks. */ + across blocks. */ if (def->bb ()->cfg_bb ()->index == insn->bb ()->cfg_bb ()->index) { set_info *set = safe_dyn_cast (def); @@ -406,7 +406,7 @@ can_backward_propagate_p (const function_info *ssa, const basic_block cfg_bb, if (def->bb ()->cfg_bb ()->index == cfg_bb->index) return true; - /* Make sure we don't backward propagete the VL/VTYPE info over the + /* Make sure we don't backward propagate the VL/VTYPE info over the definition blocks. */ bool visited_p = false; for (const bb_info *bb : ssa->reverse_bbs ())