summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorJim Grosbach <grosbach@apple.com>2010-08-04 22:10:15 +0000
committerJim Grosbach <grosbach@apple.com>2010-08-04 22:10:15 +0000
commit22be317fe47d05fdab87c111c67d687bee1b5e29 (patch)
tree2cd89a2d78d981c1e669e1d3c3a2a1510ba449a3 /llvm/lib
parentdc96e28d70dc19427a38e47032b196f49ff67925 (diff)
downloadbcm5719-llvm-22be317fe47d05fdab87c111c67d687bee1b5e29.tar.gz
bcm5719-llvm-22be317fe47d05fdab87c111c67d687bee1b5e29.zip
Reserve a stack slot if the function adjusts the stack but doesn't
simplify the call frame pseudo instructions. In that situation, the calculations for estimating the stack size will be way off, leading to not having an emergency spill slot when we need one. It should be possible to be more precise about tracking the adjustment values, but not really necessary for correctness. Upcoming cleanups for PEI in general will render that moot. llvm-svn: 110258
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp b/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
index cd37633d967..855e07232d3 100644
--- a/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
+++ b/llvm/lib/Target/ARM/ARMBaseRegisterInfo.cpp
@@ -851,13 +851,18 @@ ARMBaseRegisterInfo::processFunctionBeforeCalleeSavedScan(MachineFunction &MF,
// slot of the previous FP. Also, if we have variable sized objects in the
// function, stack slot references will often be negative, and some of
// our instructions are positive-offset only, so conservatively consider
- // that case to want a spill slot (or register) as well.
+ // that case to want a spill slot (or register) as well. Similarly, if
+ // the function adjusts the stack pointer during execution and the
+ // adjustments aren't already part of our stack size estimate, our offset
+ // calculations may be off, so be conservative.
// FIXME: We could add logic to be more precise about negative offsets
// and which instructions will need a scratch register for them. Is it
// worth the effort and added fragility?
bool BigStack =
(RS && (estimateStackSize(MF) + (hasFP(MF) ? 4:0) >=
- estimateRSStackSizeLimit(MF))) || MFI->hasVarSizedObjects();
+ estimateRSStackSizeLimit(MF))
+ || MFI->hasVarSizedObjects()
+ || (MFI->adjustsStack() && !canSimplifyCallFramePseudos(MF)));
bool ExtraCSSpill = false;
if (BigStack || !CanEliminateFrame || cannotEliminateFrame(MF)) {
OpenPOWER on IntegriCloud