Skip to content

Commit

Permalink
Verify regunit intervals along with virtreg intervals.
Browse files Browse the repository at this point in the history
Don't cause regunit intervals to be computed just to verify them. Only
check the already cached intervals.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161183 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
stoklund committed Aug 2, 2012
1 parent e2b83ab commit 8044689
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions lib/CodeGen/MachineVerifier.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1170,6 +1170,11 @@ void MachineVerifier::verifyLiveIntervals() {
assert(Reg == LI.reg && "Invalid reg to interval mapping");
verifyLiveInterval(LI);
}

// Verify all the cached regunit intervals.
for (unsigned i = 0, e = TRI->getNumRegUnits(); i != e; ++i)
if (const LiveInterval *LI = LiveInts->getCachedRegUnit(i))
verifyLiveInterval(*LI);
}

void MachineVerifier::verifyLiveIntervalValue(const LiveInterval &LI,
Expand Down Expand Up @@ -1227,7 +1232,7 @@ void MachineVerifier::verifyLiveIntervalValue(const LiveInterval &LI,
continue;
} else {
if (!TargetRegisterInfo::isPhysicalRegister(MOI->getReg()) ||
!TRI->regsOverlap(LI.reg, MOI->getReg()))
!TRI->hasRegUnit(MOI->getReg(), LI.reg))
continue;
}
hasDef = true;
Expand Down Expand Up @@ -1294,6 +1299,11 @@ MachineVerifier::verifyLiveIntervalSegment(const LiveInterval &LI,
if (I->end == LiveInts->getMBBEndIdx(EndMBB))
return;

// RegUnit intervals are allowed dead phis.
if (!TargetRegisterInfo::isVirtualRegister(LI.reg) && VNI->isPHIDef() &&
I->start == VNI->def && I->end == VNI->def.getDeadSlot())
return;

// The live segment is ending inside EndMBB
const MachineInstr *MI =
LiveInts->getInstructionFromIndex(I->end.getPrevSlot());
Expand Down Expand Up @@ -1371,7 +1381,7 @@ MachineVerifier::verifyLiveIntervalSegment(const LiveInterval &LI,
for (;;) {
assert(LiveInts->isLiveInToMBB(LI, MFI));
// We don't know how to track physregs into a landing pad.
if (TargetRegisterInfo::isPhysicalRegister(LI.reg) &&
if (!TargetRegisterInfo::isVirtualRegister(LI.reg) &&
MFI->isLandingPad()) {
if (&*MFI == EndMBB)
break;
Expand Down

0 comments on commit 8044689

Please sign in to comment.