diff options
author | Tim Northover <tnorthover@apple.com> | 2013-12-09 09:05:30 +0000 |
---|---|---|
committer | Tim Northover <tnorthover@apple.com> | 2013-12-09 09:05:30 +0000 |
commit | 54ed08e250a76b570c2162d49633e11b8ebb2d98 (patch) | |
tree | 7391ecf1a422133317d0242a99306f576ad03870 /lib | |
parent | 7d9c02dc620ea5f5cdf2dc0bd0f03d9370f845d3 (diff) | |
download | external_llvm-54ed08e250a76b570c2162d49633e11b8ebb2d98.zip external_llvm-54ed08e250a76b570c2162d49633e11b8ebb2d98.tar.gz external_llvm-54ed08e250a76b570c2162d49633e11b8ebb2d98.tar.bz2 |
Merge r196725 (conflicts on same API as before):
------------------------------------------------------------------------
r196725 | tnorthover | 2013-12-08 15:56:50 +0000 (Sun, 08 Dec 2013) |
19 lines
ARM: fix folding of stack-adjustment (yet again).
When trying to eliminate an "sub sp, sp, #N" instruction by folding
it into an existing push/pop using dummy registers, we need to account
for the fact that this might affect precisely how "fp" gets set in the
prologue.
We were attempting this, but assuming that *whenever* we performed a
fold it would make a difference. This is false, for example, in:
push {r4, r7, lr}
add fp, sp, #4
vpush {d8}
sub sp, sp, #8
we can fold the "sub" into the "vpush", forming "vpush {d7, d8}".
However, in that case the "add fp" instruction mustn't change, which
we were getting wrong before.
Should fix PR18160.
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@196769 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Target/ARM/ARMFrameLowering.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Target/ARM/ARMFrameLowering.cpp b/lib/Target/ARM/ARMFrameLowering.cpp index 1457ace..d32bdbc 100644 --- a/lib/Target/ARM/ARMFrameLowering.cpp +++ b/lib/Target/ARM/ARMFrameLowering.cpp @@ -256,9 +256,10 @@ void ARMFrameLowering::emitPrologue(MachineFunction &MF) const { if (NumBytes) { // Adjust SP after all the callee-save spills. - if (tryFoldSPUpdateIntoPushPop(MF, LastPush, NumBytes)) - FramePtrOffsetInPush += NumBytes; - else + if (tryFoldSPUpdateIntoPushPop(MF, LastPush, NumBytes)) { + if (LastPush == FramePtrPush) + FramePtrOffsetInPush += NumBytes; + } else emitSPUpdate(isARM, MBB, MBBI, dl, TII, -NumBytes, MachineInstr::FrameSetup); |