diff options
author | Tim Northover <tnorthover@apple.com> | 2013-12-01 14:16:24 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2013-12-01 14:16:24 +0000 |
commit | 45479dcf49845d2faace66c12921be1412721265 (patch) | |
tree | a85d9beed9f037c20568ea1f09489e0efa6e7985 /llvm/lib/Target/ARM/Thumb1FrameLowering.cpp | |
parent | 6b7247263f02204869a27d48ca4818812e283bce (diff) | |
download | bcm5719-llvm-45479dcf49845d2faace66c12921be1412721265.tar.gz bcm5719-llvm-45479dcf49845d2faace66c12921be1412721265.zip |
ARM: fix bug in -Oz stack adjustment folding
Previously, we clobbered callee-saved registers when folding an "add
sp, #N" into a "pop {rD, ...}" instruction. This change checks whether
a register we're going to add to the "pop" could actually be live
outside the function before doing so and should fix the issue.
This should fix PR18081.
llvm-svn: 196046
Diffstat (limited to 'llvm/lib/Target/ARM/Thumb1FrameLowering.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/Thumb1FrameLowering.cpp | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp b/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp index d921c82cfb0..cfb33f5b821 100644 --- a/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp +++ b/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp @@ -215,13 +215,6 @@ void Thumb1FrameLowering::emitPrologue(MachineFunction &MF) const { AFI->setShouldRestoreSPFromFP(true); } -static bool isCalleeSavedRegister(unsigned Reg, const uint16_t *CSRegs) { - for (unsigned i = 0; CSRegs[i]; ++i) - if (Reg == CSRegs[i]) - return true; - return false; -} - static bool isCSRestore(MachineInstr *MI, const uint16_t *CSRegs) { if (MI->getOpcode() == ARM::tLDRspi && MI->getOperand(1).isFI() && |