Print out the connected components in the verifier after complaining about their
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 29 Oct 2010 00:40:57 +0000 (00:40 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Fri, 29 Oct 2010 00:40:57 +0000 (00:40 +0000)
multiplicity.

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

include/llvm/CodeGen/LiveInterval.h
lib/CodeGen/MachineVerifier.cpp

index 57f0b624244fbd36ac2d22926520cfe93377175e..c21df28cdd02ad65235a4511d073087b86202492 100644 (file)
@@ -578,10 +578,15 @@ namespace llvm {
     /// Return the number of connected components.
     unsigned Classify(const LiveInterval *LI);
 
-    // Distribute values in LIV[0] into a separate LiveInterval for each connected
-    // component. LIV must have a LiveInterval for each connected component.
-    // The LiveIntervals in Liv[1..] must be empty.
+    /// getEqClass - Classify creates equivalence classes numbered 0..N. Return
+    /// the equivalence class assigned the VNI.
+    unsigned getEqClass(const VNInfo *VNI) { return eqClass_[VNI->id]; }
+
+    /// Distribute - Distribute values in LIV[0] into a separate LiveInterval
+    /// for each connected component. LIV must have a LiveInterval for each
+    /// connected component. The LiveIntervals in Liv[1..] must be empty.
     void Distribute(LiveInterval *LIV[]);
+
   };
 
 }
index 352c01d91d42ded3e0f90b15a3951131cb5fbe2e..48597c25b3e0d744ac0e405bd06aa9aca8b67eb3 100644 (file)
@@ -1080,6 +1080,14 @@ void MachineVerifier::verifyLiveIntervals() {
       if (NumComp > 1) {
         report("Multiple connected components in live interval", MF);
         *OS << NumComp << " components in " << LI << '\n';
+        for (unsigned comp = 0; comp != NumComp; ++comp) {
+          *OS << comp << ": valnos";
+          for (LiveInterval::const_vni_iterator I = LI.vni_begin(),
+               E = LI.vni_end(); I!=E; ++I)
+            if (comp == ConEQ.getEqClass(*I))
+              *OS << ' ' << (*I)->id;
+          *OS << '\n';
+        }
       }
     }
   }