diff --git a/include/llvm/CodeGen/LiveInterval.h b/include/llvm/CodeGen/LiveInterval.h index 57f0b624244..c21df28cdd0 100644 --- a/include/llvm/CodeGen/LiveInterval.h +++ b/include/llvm/CodeGen/LiveInterval.h @@ -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[]); + }; } diff --git a/lib/CodeGen/MachineVerifier.cpp b/lib/CodeGen/MachineVerifier.cpp index 352c01d91d4..48597c25b3e 100644 --- a/lib/CodeGen/MachineVerifier.cpp +++ b/lib/CodeGen/MachineVerifier.cpp @@ -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'; + } } } }