callee-saved restore code. It could skip over conditional jumps
accidentally. Instead, just skip the "return" instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58489
91177308-0d34-0410-b5e6-
96231b3b80d8
MBB = FI;
I = MBB->end(); --I;
- // Skip over all terminator instructions, which are part of the return
+ // Skip over all "return" instructions, which are part of the return
// sequence.
MachineBasicBlock::iterator I2 = I;
- while (I2 != MBB->begin() && (--I2)->getDesc().isTerminator())
+ while (I2 != MBB->begin() && (--I2)->getDesc().isReturn())
I = I2;
bool AtStart = I == MBB->begin();
while (MBBI != MBB.begin()) {
MachineBasicBlock::iterator PI = prior(MBBI);
unsigned Opc = PI->getOpcode();
- if (Opc != X86::POP32r && Opc != X86::POP64r &&
- !PI->getDesc().isTerminator())
+ if (Opc != X86::POP32r && Opc != X86::POP64r && !PI->getDesc().isReturn())
break;
--MBBI;
}