summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2009-02-20 10:02:23 +0000
committerOwen Anderson <resistor@mac.com>2009-02-20 10:02:23 +0000
commitf13820148bbf9866376e53c9b6930d35b8da699a (patch)
tree0ed7fd5c8cf394674bfa000a4413f09c8691d1c5 /llvm/lib/CodeGen
parent81db491b7f7e053513e5f61e23b8976662dcbde5 (diff)
downloadbcm5719-llvm-f13820148bbf9866376e53c9b6930d35b8da699a.tar.gz
bcm5719-llvm-f13820148bbf9866376e53c9b6930d35b8da699a.zip
Fix a crash in the pre-alloc splitter exposed by recent codegen changes.
llvm-svn: 65121
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/PreAllocSplitting.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/PreAllocSplitting.cpp b/llvm/lib/CodeGen/PreAllocSplitting.cpp
index ef2cfdb9828..9e955bd6969 100644
--- a/llvm/lib/CodeGen/PreAllocSplitting.cpp
+++ b/llvm/lib/CodeGen/PreAllocSplitting.cpp
@@ -224,6 +224,9 @@ PreAllocSplitting::findSpillPoint(MachineBasicBlock *MBB, MachineInstr *MI,
if (RefsInMBB.empty() && !DefMI) {
MachineBasicBlock::iterator MII = MBB->begin();
MachineBasicBlock::iterator EndPt = MI;
+
+ if (MII == EndPt) return Pt;
+
do {
++MII;
unsigned Index = LIs->getInstructionIndex(MII);
@@ -303,6 +306,9 @@ PreAllocSplitting::findRestorePoint(MachineBasicBlock *MBB, MachineInstr *MI,
if (RefsInMBB.empty() && LastIdx >= EndIdx) {
MachineBasicBlock::iterator MII = MBB->getFirstTerminator();
MachineBasicBlock::iterator EndPt = MI;
+
+ if (MII == EndPt) return Pt;
+
--MII;
do {
unsigned Index = LIs->getInstructionIndex(MII);
OpenPOWER on IntegriCloud