Skip to content

Commit

Permalink
[RISCV] Add LiveInterval assertions in insertVSETVLI. NFC
Browse files Browse the repository at this point in the history
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
  • Loading branch information
lukel97 committed Jul 10, 2024
1 parent 1782810 commit 5ab755c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion llvm/lib/Target/RISCV/RISCVInsertVSETVLI.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1163,7 +1163,10 @@ void RISCVInsertVSETVLI::insertVSETVLI(MachineBasicBlock &MBB,
// isn't always the case, e.g. PseudoVMV_X_S doesn't have an AVL operand or
// we've taken the AVL from the VL output of another vsetvli.
LiveInterval &LI = LIS->getInterval(AVLReg);
LIS->extendToIndices(LI, {LIS->getInstructionIndex(*MI).getRegSlot()});
SlotIndex SI = LIS->getInstructionIndex(*MI).getRegSlot();
assert((LI.liveAt(SI) && LI.getVNInfoAt(SI) == Info.getAVLVNInfo()) ||
(!LI.liveAt(SI) && LI.containsOneValue()));
LIS->extendToIndices(LI, SI);
}
}

Expand Down

0 comments on commit 5ab755c

Please sign in to comment.