diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-01-25 01:28:33 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-01-25 01:28:33 +0000 |
commit | d6093ff4cb24561ee9b656a16ea3bb2552546b6f (patch) | |
tree | c61926114a94e8b80cac659783489a443ab87cf0 /llvm/lib | |
parent | a7b224140784fb4694109e9a6d62097d246bdcd1 (diff) | |
download | bcm5719-llvm-d6093ff4cb24561ee9b656a16ea3bb2552546b6f.tar.gz bcm5719-llvm-d6093ff4cb24561ee9b656a16ea3bb2552546b6f.zip |
Don't merge restore with tail call instruction.
llvm-svn: 124167
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Target/ARM/ARMFrameLowering.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.cpp b/llvm/lib/Target/ARM/ARMFrameLowering.cpp index c2739f6d6d5..70838f5d11c 100644 --- a/llvm/lib/Target/ARM/ARMFrameLowering.cpp +++ b/llvm/lib/Target/ARM/ARMFrameLowering.cpp @@ -586,6 +586,11 @@ void ARMFrameLowering::emitPopInst(MachineBasicBlock &MBB, const TargetInstrInfo &TII = *MF.getTarget().getInstrInfo(); ARMFunctionInfo *AFI = MF.getInfo<ARMFunctionInfo>(); DebugLoc DL = MI->getDebugLoc(); + unsigned RetOpcode = MI->getOpcode(); + bool isTailCall = (RetOpcode == ARM::TCRETURNdi || + RetOpcode == ARM::TCRETURNdiND || + RetOpcode == ARM::TCRETURNri || + RetOpcode == ARM::TCRETURNriND); SmallVector<unsigned, 4> Regs; unsigned i = CSI.size(); @@ -596,7 +601,7 @@ void ARMFrameLowering::emitPopInst(MachineBasicBlock &MBB, unsigned Reg = CSI[i-1].getReg(); if (!(Func)(Reg, STI.isTargetDarwin())) continue; - if (Reg == ARM::LR && !isVarArg && STI.hasV5TOps()) { + if (Reg == ARM::LR && !isTailCall && !isVarArg && STI.hasV5TOps()) { Reg = ARM::PC; LdmOpc = AFI->isThumbFunction() ? ARM::t2LDMIA_RET : ARM::LDMIA_RET; // Fold the return instruction into the LDM. |