Skip unused registers when verifying LiveIntervals.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 6 Oct 2010 23:54:35 +0000 (23:54 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Wed, 6 Oct 2010 23:54:35 +0000 (23:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115874 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineVerifier.cpp

index 5660e48b8e67ad3981000c286df6d8725b401d6e..644e3c06da17ed45a900abc99c97555454c9792c 100644 (file)
@@ -884,6 +884,11 @@ void MachineVerifier::verifyLiveIntervals() {
   for (LiveIntervals::const_iterator LVI = LiveInts->begin(),
        LVE = LiveInts->end(); LVI != LVE; ++LVI) {
     const LiveInterval &LI = *LVI->second;
+
+    // Spilling and splitting may leave unused registers around. Skip them.
+    if (MRI->use_empty(LI.reg))
+      continue;
+
     assert(LVI->first == LI.reg && "Invalid reg to interval mapping");
 
     for (LiveInterval::const_vni_iterator I = LI.vni_begin(), E = LI.vni_end();