[llvm-commits] [llvm] r161183 - /llvm/trunk/lib/CodeGen/MachineVerifier.cpp
Jakob Stoklund Olesen
stoklund at 2pi.dk
Thu Aug 2 09:36:50 PDT 2012
Author: stoklund
Date: Thu Aug 2 11:36:50 2012
New Revision: 161183
URL: http://llvm.org/viewvc/llvm-project?rev=161183&view=rev
Log:
Verify regunit intervals along with virtreg intervals.
Don't cause regunit intervals to be computed just to verify them. Only
check the already cached intervals.
Modified:
llvm/trunk/lib/CodeGen/MachineVerifier.cpp
Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineVerifier.cpp?rev=161183&r1=161182&r2=161183&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Thu Aug 2 11:36:50 2012
@@ -1170,6 +1170,11 @@
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,
@@ -1227,7 +1232,7 @@
continue;
} else {
if (!TargetRegisterInfo::isPhysicalRegister(MOI->getReg()) ||
- !TRI->regsOverlap(LI.reg, MOI->getReg()))
+ !TRI->hasRegUnit(MOI->getReg(), LI.reg))
continue;
}
hasDef = true;
@@ -1294,6 +1299,11 @@
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());
@@ -1371,7 +1381,7 @@
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;
More information about the llvm-commits
mailing list