Revert r58489. It isn't correct for all cases.
authorBill Wendling <isanbard@gmail.com>
Fri, 31 Oct 2008 18:30:19 +0000 (18:30 +0000)
committerBill Wendling <isanbard@gmail.com>
Fri, 31 Oct 2008 18:30:19 +0000 (18:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58523 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/PrologEpilogInserter.cpp
lib/Target/X86/X86RegisterInfo.cpp

index 2469c8e000c4fdacafeb27d20c9e187701b60901..d3b0b11c705957eb2a720b6de1fd0d5e3727a186 100644 (file)
@@ -273,10 +273,10 @@ void PEI::saveCalleeSavedRegisters(MachineFunction &Fn) {
       MBB = FI;
       I = MBB->end(); --I;
 
-      // Skip over all "return" instructions, which are part of the return
+      // Skip over all terminator instructions, which are part of the return
       // sequence.
       MachineBasicBlock::iterator I2 = I;
-      while (I2 != MBB->begin() && (--I2)->getDesc().isReturn())
+      while (I2 != MBB->begin() && (--I2)->getDesc().isTerminator())
         I = I2;
 
       bool AtStart = I == MBB->begin();
index 9e9495dd12b707cafb9f948a31a7afe5b534fedd..97e1de729a14694e4ef55a8aa70cfac454557a8c 100644 (file)
@@ -850,7 +850,8 @@ void X86RegisterInfo::emitEpilogue(MachineFunction &MF,
   while (MBBI != MBB.begin()) {
     MachineBasicBlock::iterator PI = prior(MBBI);
     unsigned Opc = PI->getOpcode();
-    if (Opc != X86::POP32r && Opc != X86::POP64r && !PI->getDesc().isReturn())
+    if (Opc != X86::POP32r && Opc != X86::POP64r &&
+        !PI->getDesc().isTerminator())
       break;
     --MBBI;
   }