Make sure epilogue esp adjustment is placed before any terminator and pop instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40538 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Evan Cheng 2007-07-26 17:45:41 +00:00
parent 85dce6cf78
commit fcc8793dc8

View File

@ -1372,8 +1372,9 @@ void X86RegisterInfo::emitEpilogue(MachineFunction &MF,
// Skip the callee-saved pop instructions.
while (MBBI != MBB.begin()) {
MachineBasicBlock::iterator PI = prior(MBBI);
if (PI->getOpcode() != X86::POP32r && PI->getOpcode() != X86::POP64r)
MachineBasicBlock::iterator PI = prior(MBBI);
unsigned Opc = PI->getOpcode();
if (Opc != X86::POP32r && Opc != X86::POP64r && !TII.isTerminatorInstr(Opc))
break;
--MBBI;
}