diff options
author | Chad Rosier <mcrosier@apple.com> | 2011-10-18 05:28:00 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2011-10-18 05:28:00 +0000 |
commit | 0ffe593a16767296dabdd7008aeec690ea07dacb (patch) | |
tree | 6c7cc78da8fba2b3a4c963f06cb248480804e6b2 /llvm/lib/Target/ARM/ARMFrameLowering.cpp | |
parent | 1c192774b6766809642432476c7266a3911df8fd (diff) | |
download | bcm5719-llvm-0ffe593a16767296dabdd7008aeec690ea07dacb.tar.gz bcm5719-llvm-0ffe593a16767296dabdd7008aeec690ea07dacb.zip |
Add support for dynamic stack realignment when in thumb1 mode.
rdar://10288916
llvm-svn: 142337
Diffstat (limited to 'llvm/lib/Target/ARM/ARMFrameLowering.cpp')
-rw-r--r-- | llvm/lib/Target/ARM/ARMFrameLowering.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/Target/ARM/ARMFrameLowering.cpp b/llvm/lib/Target/ARM/ARMFrameLowering.cpp index 2d1de6fe8e9..4bac6c5fa95 100644 --- a/llvm/lib/Target/ARM/ARMFrameLowering.cpp +++ b/llvm/lib/Target/ARM/ARMFrameLowering.cpp @@ -881,10 +881,12 @@ ARMFrameLowering::processFunctionBeforeCalleeSavedScan(MachineFunction &MF, // for sure what the stack size will be, but for this, an estimate is good // enough. If there anything changes it, it'll be a spill, which implies // we've used all the registers and so R4 is already used, so not marking - // it here will be OK. + // it here will be OK. Also spill R4 if Thumb1 function requires stack + // realignment. // FIXME: It will be better just to find spare register here. unsigned StackSize = estimateStackSize(MF); - if (MFI->hasVarSizedObjects() || StackSize > 508) + if (MFI->hasVarSizedObjects() || RegInfo->needsStackRealignment(MF) || + StackSize > 508) MF.getRegInfo().setPhysRegUsed(ARM::R4); } |