From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2093) id 2C76D385703A; Fri, 27 Jan 2023 09:36:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2C76D385703A DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1674812188; bh=NffZxHLp1TCdUxXjj4pQCNQK3tKI6YybhMU25XeEvSY=; h=From:To:Subject:Date:From; b=Pe5yJMekOCwCdTaM2ATMyIxxNQzpXr30yTlUJpunyqD24WN+QdWGKAmBTWJGPZ6Xv 9hwJenYC0Z3f3aQp2Qn3IG6z5VAZydsrwFiSvSixVW+ubHTPB48av9obukU6mBG8wo 7dEDc92MPLlTRiaEqu0m7p36KNQfKjG/cuuPJr+8= MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Kito Cheng To: gcc-cvs@gcc.gnu.org Subject: [gcc r13-5428] RISC-V: Change VSETVL PASS always call split_all_insns X-Act-Checkin: gcc X-Git-Author: Ju-Zhe Zhong X-Git-Refname: refs/heads/master X-Git-Oldrev: e3bcf0726207185af88dd3c8fbed35b05cd80ddd X-Git-Newrev: ca8fb0096713a8477614ef874f16ba5bf16c48bc Message-Id: <20230127093628.2C76D385703A@sourceware.org> Date: Fri, 27 Jan 2023 09:36:28 +0000 (GMT) List-Id: https://gcc.gnu.org/g:ca8fb0096713a8477614ef874f16ba5bf16c48bc commit r13-5428-gca8fb0096713a8477614ef874f16ba5bf16c48bc Author: Ju-Zhe Zhong Date: Wed Jan 18 10:50:14 2023 +0800 RISC-V: Change VSETVL PASS always call split_all_insns Since LCM will destroy CFG, we are going to reorder the location of VSETVL PASS at least before bbro (block-reorder PASS) which is before split3 PASS. We need to call it in VSETVL PASS to get final RVV instructions patterns. gcc/ChangeLog: * config/riscv/riscv-vsetvl.cc (pass_vsetvl::execute): Always call split_all_insns. Diff: --- gcc/config/riscv/riscv-vsetvl.cc | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/gcc/config/riscv/riscv-vsetvl.cc b/gcc/config/riscv/riscv-vsetvl.cc index e4bc3d2b353..8b3fd33f558 100644 --- a/gcc/config/riscv/riscv-vsetvl.cc +++ b/gcc/config/riscv/riscv-vsetvl.cc @@ -3086,12 +3086,10 @@ pass_vsetvl::execute (function *) if (n_basic_blocks_for_fn (cfun) <= 0) return 0; - /* The reason we have this since we didn't finish splitting yet - when optimize == 0. In this case, we should conservatively - split all instructions here to make sure we don't miss any - RVV instruction. */ - if (!optimize) - split_all_insns (); + /* The RVV instruction may change after split which is not a stable + instruction. We need to split it here to avoid potential issue + since the VSETVL PASS is insert before split PASS. */ + split_all_insns (); /* Early return for there is no vector instructions. */ if (!has_vector_insn (cfun))