Don't allow the restore point to be placed after terminators. With this change,
authorOwen Anderson <resistor@mac.com>
Thu, 13 Nov 2008 21:53:14 +0000 (21:53 +0000)
committerOwen Anderson <resistor@mac.com>
Thu, 13 Nov 2008 21:53:14 +0000 (21:53 +0000)
MultiSource/Applications is clean with the prealloc splitter.  Some failures
remain in SPEC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59267 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/PreAllocSplitting.cpp

index f7d8ab01026d0c672d21e58e34a0637b0470e579..dfbc796cd3fc36b5371ec7b229f5b43691749672 100644 (file)
@@ -233,13 +233,13 @@ PreAllocSplitting::findRestorePoint(MachineBasicBlock *MBB, MachineInstr *MI,
                                     unsigned &RestoreIndex) {
   // FIXME: Allow spill to be inserted to the beginning of the mbb. Update mbb
   // begin index accordingly.
-  MachineBasicBlock::iterator Pt = MBB->end();
+  MachineBasicBlock::iterator Pt = MBB->getFirstTerminator();
   unsigned EndIdx = LIs->getMBBEndIdx(MBB);
 
   // Go bottom up if RefsInMBB is empty and the end of the mbb isn't beyond
   // the last index in the live range.
   if (RefsInMBB.empty() && LastIdx >= EndIdx) {
-    MachineBasicBlock::iterator MII = MBB->end();
+    MachineBasicBlock::iterator MII = MBB->getFirstTerminator();
     MachineBasicBlock::iterator EndPt = MI;
     --MII;
     do {