summaryrefslogtreecommitdiff
path: root/contrib/llvm-project/llvm/lib/CodeGen/LiveInterval.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/llvm-project/llvm/lib/CodeGen/LiveInterval.cpp')
-rw-r--r--contrib/llvm-project/llvm/lib/CodeGen/LiveInterval.cpp26
1 files changed, 8 insertions, 18 deletions
diff --git a/contrib/llvm-project/llvm/lib/CodeGen/LiveInterval.cpp b/contrib/llvm-project/llvm/lib/CodeGen/LiveInterval.cpp
index 930dc116205a..70b2a77fe800 100644
--- a/contrib/llvm-project/llvm/lib/CodeGen/LiveInterval.cpp
+++ b/contrib/llvm-project/llvm/lib/CodeGen/LiveInterval.cpp
@@ -883,11 +883,10 @@ void LiveInterval::clearSubRanges() {
static void stripValuesNotDefiningMask(unsigned Reg, LiveInterval::SubRange &SR,
LaneBitmask LaneMask,
const SlotIndexes &Indexes,
- const TargetRegisterInfo &TRI,
- unsigned ComposeSubRegIdx) {
+ const TargetRegisterInfo &TRI) {
// Phys reg should not be tracked at subreg level.
// Same for noreg (Reg == 0).
- if (!Register::isVirtualRegister(Reg) || !Reg)
+ if (!TargetRegisterInfo::isVirtualRegister(Reg) || !Reg)
return;
// Remove the values that don't define those lanes.
SmallVector<VNInfo *, 8> ToBeRemoved;
@@ -906,12 +905,7 @@ static void stripValuesNotDefiningMask(unsigned Reg, LiveInterval::SubRange &SR,
continue;
if (MOI->getReg() != Reg)
continue;
- LaneBitmask OrigMask = TRI.getSubRegIndexLaneMask(MOI->getSubReg());
- LaneBitmask ExpectedDefMask =
- ComposeSubRegIdx
- ? TRI.composeSubRegIndexLaneMask(ComposeSubRegIdx, OrigMask)
- : OrigMask;
- if ((ExpectedDefMask & LaneMask).none())
+ if ((TRI.getSubRegIndexLaneMask(MOI->getSubReg()) & LaneMask).none())
continue;
hasDef = true;
break;
@@ -923,15 +917,13 @@ static void stripValuesNotDefiningMask(unsigned Reg, LiveInterval::SubRange &SR,
for (VNInfo *VNI : ToBeRemoved)
SR.removeValNo(VNI);
- // If the subrange is empty at this point, the MIR is invalid. Do not assert
- // and let the verifier catch this case.
+ assert(!SR.empty() && "At least one value should be defined by this mask");
}
void LiveInterval::refineSubRanges(
BumpPtrAllocator &Allocator, LaneBitmask LaneMask,
std::function<void(LiveInterval::SubRange &)> Apply,
- const SlotIndexes &Indexes, const TargetRegisterInfo &TRI,
- unsigned ComposeSubRegIdx) {
+ const SlotIndexes &Indexes, const TargetRegisterInfo &TRI) {
LaneBitmask ToApply = LaneMask;
for (SubRange &SR : subranges()) {
LaneBitmask SRMask = SR.LaneMask;
@@ -951,10 +943,8 @@ void LiveInterval::refineSubRanges(
MatchingRange = createSubRangeFrom(Allocator, Matching, SR);
// Now that the subrange is split in half, make sure we
// only keep in the subranges the VNIs that touch the related half.
- stripValuesNotDefiningMask(reg, *MatchingRange, Matching, Indexes, TRI,
- ComposeSubRegIdx);
- stripValuesNotDefiningMask(reg, SR, SR.LaneMask, Indexes, TRI,
- ComposeSubRegIdx);
+ stripValuesNotDefiningMask(reg, *MatchingRange, Matching, Indexes, TRI);
+ stripValuesNotDefiningMask(reg, SR, SR.LaneMask, Indexes, TRI);
}
Apply(*MatchingRange);
ToApply &= ~Matching;
@@ -977,7 +967,7 @@ void LiveInterval::computeSubRangeUndefs(SmallVectorImpl<SlotIndex> &Undefs,
LaneBitmask LaneMask,
const MachineRegisterInfo &MRI,
const SlotIndexes &Indexes) const {
- assert(Register::isVirtualRegister(reg));
+ assert(TargetRegisterInfo::isVirtualRegister(reg));
LaneBitmask VRegMask = MRI.getMaxLaneMaskForVReg(reg);
assert((VRegMask & LaneMask).any());
const TargetRegisterInfo &TRI = *MRI.getTargetRegisterInfo();