[llvm-branch-commits] [llvm-branch] r98605 - in /llvm/branches/Apple/Morbo: ./ lib/CodeGen/RegAllocLocal.cpp

Bill Wendling isanbard at gmail.com
Mon Mar 15 19:02:20 PDT 2010


Author: void
Date: Mon Mar 15 21:02:20 2010
New Revision: 98605

URL: http://llvm.org/viewvc/llvm-project?rev=98605&view=rev
Log:
$ svn merge -c 98604 https://llvm.org/svn/llvm-project/llvm/trunk
--- Merging r98604 into '.':
U    lib/CodeGen/RegAllocLocal.cpp


Modified:
    llvm/branches/Apple/Morbo/   (props changed)
    llvm/branches/Apple/Morbo/lib/CodeGen/RegAllocLocal.cpp

Propchange: llvm/branches/Apple/Morbo/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Mon Mar 15 21:02:20 2010
@@ -1 +1 @@
-/llvm/trunk:98602
+/llvm/trunk:98602,98604

Modified: llvm/branches/Apple/Morbo/lib/CodeGen/RegAllocLocal.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Morbo/lib/CodeGen/RegAllocLocal.cpp?rev=98605&r1=98604&r2=98605&view=diff
==============================================================================
--- llvm/branches/Apple/Morbo/lib/CodeGen/RegAllocLocal.cpp (original)
+++ llvm/branches/Apple/Morbo/lib/CodeGen/RegAllocLocal.cpp Mon Mar 15 21:02:20 2010
@@ -671,9 +671,10 @@
   
   // Live-out (of the function) registers contain return values of the function,
   // so we need to make sure they are alive at return time.
-  bool BBEndsInReturn = !MBB.empty() && MBB.back().getDesc().isReturn();
-  if (BBEndsInReturn) {
-    MachineInstr* Ret = &MBB.back();
+  MachineBasicBlock::iterator Ret = MBB.getFirstTerminator();
+  bool BBEndsInReturn = (Ret != MBB.end() && Ret->getDesc().isReturn());
+
+  if (BBEndsInReturn)
     for (MachineRegisterInfo::liveout_iterator
          I = MF->getRegInfo().liveout_begin(),
          E = MF->getRegInfo().liveout_end(); I != E; ++I)
@@ -681,7 +682,6 @@
         Ret->addOperand(MachineOperand::CreateReg(*I, false, true));
         LastUseDef[*I] = std::make_pair(Ret, Ret->getNumOperands()-1);
       }
-  }
   
   // Finally, loop over the final use/def of each reg 
   // in the block and determine if it is dead.





More information about the llvm-branch-commits mailing list