aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2007-07-26 17:45:41 +0000
committerEvan Cheng <evan.cheng@apple.com>2007-07-26 17:45:41 +0000
commit942876fb080e7043b6143615dc28e8e4364f71fe (patch)
tree62ddbb57c4a2b24ed1a51b8f8256ce6da9592a0f
parent12515799e3d6b50788abe5fc5bd400e65987f194 (diff)
downloadexternal_llvm-942876fb080e7043b6143615dc28e8e4364f71fe.zip
external_llvm-942876fb080e7043b6143615dc28e8e4364f71fe.tar.gz
external_llvm-942876fb080e7043b6143615dc28e8e4364f71fe.tar.bz2
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
-rw-r--r--lib/Target/X86/X86RegisterInfo.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/Target/X86/X86RegisterInfo.cpp b/lib/Target/X86/X86RegisterInfo.cpp
index 29bdf94..bd4179f 100644
--- a/lib/Target/X86/X86RegisterInfo.cpp
+++ b/lib/Target/X86/X86RegisterInfo.cpp
@@ -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;
}