summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-08-31 18:52:31 +0000
committerJim Grosbach <grosbach@apple.com>2010-08-31 18:52:31 +0000
commit9ce9210e475903b117b72089565eb38b3dfcc80c (patch)
tree603d2b85b240fe9a19e2378fd35f41c3e047c145 /llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
parent8559932d36eff4a83c154ea52964c462112a56e7 (diff)
downloadbcm5719-llvm-9ce9210e475903b117b72089565eb38b3dfcc80c.tar.gz
bcm5719-llvm-9ce9210e475903b117b72089565eb38b3dfcc80c.zip
SP relative offsets need to be adjusted by the local allocation size when
determining if they're likely to be in range of the SP when resolving frame references. llvm-svn: 112624
Diffstat (limited to 'llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp')
-rw-r--r--llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp b/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
index e692988fd52..07c890de5cc 100644
--- a/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
@@ -1480,7 +1480,11 @@ needsFrameBaseReg(MachineInstr *MI, int64_t Offset) const {
if (!AFI->isThumbFunction() || !AFI->isThumb1OnlyFunction())
FPOffset -= 80;
// Estimate an offset from the stack pointer.
+ // The incoming offset is relating to the SP at the start of the function,
+ // but when we access the local it'll be relative to the SP after local
+ // allocation, so adjust our SP-relative offset by that allocation size.
Offset = -Offset;
+ Offset += MFI->getLocalFrameSize();
// Assume that we'll have at least some spill slots allocated.
// FIXME: This is a total SWAG number. We should run some statistics
// and pick a real one.
OpenPOWER on IntegriCloud