Verify that live intervals are connected. If there are multiple connected
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 26 Oct 2010 22:36:07 +0000 (22:36 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Tue, 26 Oct 2010 22:36:07 +0000 (22:36 +0000)
components, each should get its own virtual register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117407 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineVerifier.cpp

index d6d7dd45cc24ac4783122bdee56d0ee75a226c97..b5211ee65b325419c7ab48ba3dce35b4a9595924 100644 (file)
@@ -167,7 +167,7 @@ namespace {
 
     // Analysis information if available
     LiveVariables *LiveVars;
-    const LiveIntervals *LiveInts;
+    LiveIntervals *LiveInts;
     SlotIndexes *Indexes;
 
     void visitMachineFunctionBefore();
@@ -1067,6 +1067,14 @@ void MachineVerifier::verifyLiveIntervals() {
         ++MFI;
       }
     }
+
+    // Check the LI only has one connected component.
+    ConnectedVNInfoEqClasses ConEQ(*LiveInts);
+    unsigned NumComp = ConEQ.Classify(&LI);
+    if (NumComp > 1) {
+      report("Multiple connected components in live interval", MF);
+      *OS << NumComp << " components in " << LI << '\n';
+    }
   }
 }