Skip to content

Commit 260fa28

Browse files
committed
Verify that live intervals are connected. If there are multiple connected
components, each should get its own virtual register. llvm-svn: 117407
1 parent 022e779 commit 260fa28

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

llvm/lib/CodeGen/MachineVerifier.cpp

+9-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ namespace {
167167

168168
// Analysis information if available
169169
LiveVariables *LiveVars;
170-
const LiveIntervals *LiveInts;
170+
LiveIntervals *LiveInts;
171171
SlotIndexes *Indexes;
172172

173173
void visitMachineFunctionBefore();
@@ -1067,6 +1067,14 @@ void MachineVerifier::verifyLiveIntervals() {
10671067
++MFI;
10681068
}
10691069
}
1070+
1071+
// Check the LI only has one connected component.
1072+
ConnectedVNInfoEqClasses ConEQ(*LiveInts);
1073+
unsigned NumComp = ConEQ.Classify(&LI);
1074+
if (NumComp > 1) {
1075+
report("Multiple connected components in live interval", MF);
1076+
*OS << NumComp << " components in " << LI << '\n';
1077+
}
10701078
}
10711079
}
10721080

0 commit comments

Comments
 (0)