Skip to content

Commit c67c5b4

Browse files
authored
[llvm][RISCV] Correct the order of statement in insertVSETMTK (#163215)
We need to set register to noreg before shrinking interval
1 parent a6fdbcb commit c67c5b4

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1945,19 +1945,19 @@ bool RISCVInsertVSETVLI::insertVSETMTK(MachineBasicBlock &MBB,
19451945
.addImm(Log2_32(CurrInfo.getTWiden()) + 1);
19461946

19471947
Changed = true;
1948+
Register Reg = Op.getReg();
1949+
Op.setReg(Register());
1950+
Op.setIsKill(false);
19481951
if (LIS) {
19491952
LIS->InsertMachineInstrInMaps(*TmpMI);
1950-
LiveInterval &LI = LIS->getInterval(Op.getReg());
1953+
LiveInterval &LI = LIS->getInterval(Reg);
19511954

19521955
// Erase the AVL operand from the instruction.
19531956
LIS->shrinkToUses(&LI);
19541957
// TODO: Enable this once needVSETVLIPHI is supported.
19551958
// SmallVector<LiveInterval *> SplitLIs;
19561959
// LIS->splitSeparateComponents(LI, SplitLIs);
19571960
}
1958-
1959-
Op.setReg(RISCV::NoRegister);
1960-
Op.setIsKill(false);
19611961
}
19621962
return Changed;
19631963
}

0 commit comments

Comments
 (0)