[llvm-commits] [llvm] r117630 - in /llvm/trunk: include/llvm/CodeGen/LiveInterval.h lib/CodeGen/MachineVerifier.cpp

Jakob Stoklund Olesen stoklund at 2pi.dk
Thu Oct 28 17:40:57 PDT 2010


Author: stoklund
Date: Thu Oct 28 19:40:57 2010
New Revision: 117630

URL: http://llvm.org/viewvc/llvm-project?rev=117630&view=rev
Log:
Print out the connected components in the verifier after complaining about their
multiplicity.

Modified:
    llvm/trunk/include/llvm/CodeGen/LiveInterval.h
    llvm/trunk/lib/CodeGen/MachineVerifier.cpp

Modified: llvm/trunk/include/llvm/CodeGen/LiveInterval.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/CodeGen/LiveInterval.h?rev=117630&r1=117629&r2=117630&view=diff
==============================================================================
--- llvm/trunk/include/llvm/CodeGen/LiveInterval.h (original)
+++ llvm/trunk/include/llvm/CodeGen/LiveInterval.h Thu Oct 28 19:40:57 2010
@@ -578,10 +578,15 @@
     /// 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[]);
+
   };
 
 }

Modified: llvm/trunk/lib/CodeGen/MachineVerifier.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/MachineVerifier.cpp?rev=117630&r1=117629&r2=117630&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/MachineVerifier.cpp (original)
+++ llvm/trunk/lib/CodeGen/MachineVerifier.cpp Thu Oct 28 19:40:57 2010
@@ -1080,6 +1080,14 @@
       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';
+        }
       }
     }
   }





More information about the llvm-commits mailing list