[llvm] [RISCV] Support postRA vsetvl insertion pass (PR #70549)
Craig Topper via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 8 20:54:30 PDT 2024
================
@@ -920,11 +1039,13 @@ void RISCVInsertVSETVLI::insertVSETVLI(MachineBasicBlock &MBB,
// Use X0, X0 form if the AVL is the same and the SEW+LMUL gives the same
// VLMAX.
if (Info.hasSameAVL(PrevInfo) && Info.hasSameVLMAX(PrevInfo)) {
- BuildMI(MBB, InsertPt, DL, TII->get(RISCV::PseudoVSETVLIX0))
- .addReg(RISCV::X0, RegState::Define | RegState::Dead)
- .addReg(RISCV::X0, RegState::Kill)
- .addImm(Info.encodeVTYPE())
- .addReg(RISCV::VL, RegState::Implicit);
+ auto NeedFixupMI =
+ BuildMI(MBB, InsertPt, DL, TII->get(RISCV::PseudoVSETVLIX0))
+ .addReg(RISCV::X0, RegState::Define | RegState::Dead)
+ .addReg(RISCV::X0, RegState::Kill)
+ .addImm(Info.encodeVTYPE())
+ .addReg(RISCV::VL, RegState::Implicit);
+ fixupModifyVRegLIAfterInsertMI(NeedFixupMI, LIS);
----------------
topperc wrote:
The instruction just inserted writes X0 and reads X0 and doesn't access any other registers. Do we need a fixup?
https://github.com/llvm/llvm-project/pull/70549
More information about the llvm-commits
mailing list