Skip to content

Commit 5ab755c

Browse files
committed
[RISCV] Add LiveInterval assertions in insertVSETVLI. NFC
If we're inserting a vsetvli that uses a register AVL, then the AVL register should either: a) Be already live at the vsetvli with the expected value b) Not be live at the vsetvli, but have exactly one value that can be extended safely: see #97264
1 parent 1782810 commit 5ab755c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1163,7 +1163,10 @@ void RISCVInsertVSETVLI::insertVSETVLI(MachineBasicBlock &MBB,
11631163
// isn't always the case, e.g. PseudoVMV_X_S doesn't have an AVL operand or
11641164
// we've taken the AVL from the VL output of another vsetvli.
11651165
LiveInterval &LI = LIS->getInterval(AVLReg);
1166-
LIS->extendToIndices(LI, {LIS->getInstructionIndex(*MI).getRegSlot()});
1166+
SlotIndex SI = LIS->getInstructionIndex(*MI).getRegSlot();
1167+
assert((LI.liveAt(SI) && LI.getVNInfoAt(SI) == Info.getAVLVNInfo()) ||
1168+
(!LI.liveAt(SI) && LI.containsOneValue()));
1169+
LIS->extendToIndices(LI, SI);
11671170
}
11681171
}
11691172

0 commit comments

Comments
 (0)