summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2011-06-13 21:18:25 +0000
committerJim Grosbach <grosbach@apple.com>2011-06-13 21:18:25 +0000
commitdca85318218cfb66775f0c62f567d36ca5bef8a8 (patch)
tree9925593a8e3ce56d415782329d20495628300226 /llvm/lib/Target/ARM/Thumb1FrameLowering.cpp
parent871b71247b01d6e2392b586c320514a0b8662b22 (diff)
downloadbcm5719-llvm-dca85318218cfb66775f0c62f567d36ca5bef8a8.tar.gz
bcm5719-llvm-dca85318218cfb66775f0c62f567d36ca5bef8a8.zip
Fix coordination for using R4 in Thumb1 as a scratch for SP restore.
The logic for reserving R4 for use as a scratch needs to match that for actually using it. Also, it's not necessary for immediate <=508, so adjust the value checked. llvm-svn: 132934
Diffstat (limited to 'llvm/lib/Target/ARM/Thumb1FrameLowering.cpp')
-rw-r--r--llvm/lib/Target/ARM/Thumb1FrameLowering.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp b/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp
index dee3d278203..e56d48168c2 100644
--- a/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp
+++ b/llvm/lib/Target/ARM/Thumb1FrameLowering.cpp
@@ -136,8 +136,8 @@ void Thumb1FrameLowering::emitPrologue(MachineFunction &MF) const {
BuildMI(MBB, MBBI, dl, TII.get(ARM::tADDrSPi), FramePtr)
.addFrameIndex(FramePtrSpillFI).addImm(0)
.setMIFlags(MachineInstr::FrameSetup);
- if (NumBytes > 7)
- // If offset is > 7 then sp cannot be adjusted in a single instruction,
+ if (NumBytes > 508)
+ // If offset is > 508 then sp cannot be adjusted in a single instruction,
// try restoring from fp instead.
AFI->setShouldRestoreSPFromFP(true);
}
OpenPOWER on IntegriCloud