From 3bf3211458b7c6f38f2b52627606313d3da9e33b Mon Sep 17 00:00:00 2001 From: Jakob Stoklund Olesen Date: Tue, 26 Oct 2010 22:36:07 +0000 Subject: [PATCH] Verify that live intervals are connected. If there are multiple connected components, each should get its own virtual register. llvm-svn: 117407 --- lib/CodeGen/MachineVerifier.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/MachineVerifier.cpp b/lib/CodeGen/MachineVerifier.cpp index d6d7dd45cc2..b5211ee65b3 100644 --- a/lib/CodeGen/MachineVerifier.cpp +++ b/lib/CodeGen/MachineVerifier.cpp @@ -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'; + } } }