diff options
| author | Evan Cheng <evan.cheng@apple.com> | 2007-07-26 17:45:41 +0000 |
|---|---|---|
| committer | Evan Cheng <evan.cheng@apple.com> | 2007-07-26 17:45:41 +0000 |
| commit | d204d08b9778ae8dcf84179e31dab0b699772e6f (patch) | |
| tree | e9dc5f9baf294276f3bfc63222d4ad3f7e337940 /llvm/lib/Target | |
| parent | 936d17aa1b8efffb227b4b2a86ca5696748430d0 (diff) | |
| download | bcm5719-llvm-d204d08b9778ae8dcf84179e31dab0b699772e6f.tar.gz bcm5719-llvm-d204d08b9778ae8dcf84179e31dab0b699772e6f.zip | |
Make sure epilogue esp adjustment is placed before any terminator and pop instructions.
llvm-svn: 40538
Diffstat (limited to 'llvm/lib/Target')
| -rw-r--r-- | llvm/lib/Target/X86/X86RegisterInfo.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Target/X86/X86RegisterInfo.cpp b/llvm/lib/Target/X86/X86RegisterInfo.cpp index 29bdf94a68d..bd4179f3486 100644 --- a/llvm/lib/Target/X86/X86RegisterInfo.cpp +++ b/llvm/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; } |

