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 | e54f6dca5074fe99d913ae1ce9bc43cf7a856b10 (patch) | |
tree | 874fc05933cc4f5332e8cc92989524a7002933f3 /lib/Target/ARM/ARMFrameLowering.cpp | |
parent | e1139818e835bbb3e7a5a377ee129d2ebb88a77d (diff) | |
download | llvm-e54f6dca5074fe99d913ae1ce9bc43cf7a856b10.tar.gz llvm-e54f6dca5074fe99d913ae1ce9bc43cf7a856b10.tar.bz2 llvm-e54f6dca5074fe99d913ae1ce9bc43cf7a856b10.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196046 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMFrameLowering.cpp')
-rw-r--r-- | lib/Target/ARM/ARMFrameLowering.cpp | 7 |
1 files changed, 0 insertions, 7 deletions
diff --git a/lib/Target/ARM/ARMFrameLowering.cpp b/lib/Target/ARM/ARMFrameLowering.cpp index 7b02803c51..3e72d3690a 100644 --- a/lib/Target/ARM/ARMFrameLowering.cpp +++ b/lib/Target/ARM/ARMFrameLowering.cpp @@ -82,13 +82,6 @@ ARMFrameLowering::canSimplifyCallFramePseudos(const MachineFunction &MF) const { return hasReservedCallFrame(MF) || MF.getFrameInfo()->hasVarSizedObjects(); } -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 ARMBaseInstrInfo &TII, const uint16_t *CSRegs) { |