Skip to content

Commit d03e812

Browse files
committed
[RISCV] Update LiveIntervals before erasing instr in RISCVInsertVSETVLI
Hopefully fixes a use-after-poison reported from the asan buildbots. I wasn't able to recreate the assertion locally though.
1 parent 77a074b commit d03e812

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1704,11 +1704,11 @@ void RISCVInsertVSETVLI::coalesceVSETVLIs(MachineBasicBlock &MBB) const {
17041704
MachineInstr *VLOpDef = MRI->getUniqueVRegDef(OldVLReg);
17051705
if (VLOpDef && TII->isAddImmediate(*VLOpDef, OldVLReg) &&
17061706
MRI->use_nodbg_empty(OldVLReg)) {
1707-
VLOpDef->eraseFromParent();
17081707
if (LIS) {
17091708
LIS->removeInterval(OldVLReg);
17101709
LIS->RemoveMachineInstrFromMaps(*VLOpDef);
17111710
}
1711+
VLOpDef->eraseFromParent();
17121712
}
17131713
}
17141714
MI.setDesc(NextMI->getDesc());

0 commit comments

Comments
 (0)