Fix a bug introduced by my previous patch. With this change, SPEC is now clean with prealloc splitting enabled.
llvm-svn: 59544
diff --git a/llvm/lib/CodeGen/PreAllocSplitting.cpp b/llvm/lib/CodeGen/PreAllocSplitting.cpp
index dfbc796..2e385c8 100644
--- a/llvm/lib/CodeGen/PreAllocSplitting.cpp
+++ b/llvm/lib/CodeGen/PreAllocSplitting.cpp
@@ -233,7 +233,7 @@
unsigned &RestoreIndex) {
// FIXME: Allow spill to be inserted to the beginning of the mbb. Update mbb
// begin index accordingly.
- MachineBasicBlock::iterator Pt = MBB->getFirstTerminator();
+ MachineBasicBlock::iterator Pt = MBB->end();
unsigned EndIdx = LIs->getMBBEndIdx(MBB);
// Go bottom up if RefsInMBB is empty and the end of the mbb isn't beyond