[llvm] [RISCV] Use LiveIntervals::extendToIndices to extend AVL in insertVSETVLI (PR #97512)
Pengcheng Wang via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 2 22:38:16 PDT 2024
================
@@ -1161,10 +1161,7 @@ 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);
- // Need to get non-const VNInfo
- VNInfo *VNI = LI.getValNumInfo(Info.getAVLVNInfo()->id);
- LI.addSegment(LiveInterval::Segment(
- VNI->def, LIS->getInstructionIndex(*MI).getRegSlot(), VNI));
+ LIS->extendToIndices(LI, {LIS->getInstructionIndex(*MI).getRegSlot()});
----------------
wangpc-pp wrote:
Why do we need to call `getRegSlot` again? Does `getInstructionIndex` return the `SlotIndex`?
https://github.com/llvm/llvm-project/pull/97512
More information about the llvm-commits
mailing list