diff options
author | Jim Grosbach <grosbach@apple.com> | 2010-03-10 20:01:30 +0000 |
---|---|---|
committer | Jim Grosbach <grosbach@apple.com> | 2010-03-10 20:01:30 +0000 |
commit | f49be7c96f5a57ba67e6b1dc4362273b5f7cbd81 (patch) | |
tree | 9e6fdc73c7f851d9f08634f46a20d1250822dd9f /lib/Target/ARM/ARMBaseRegisterInfo.cpp | |
parent | 004453e85e72a2a2ea9a70fc6b7b368feb877c4c (diff) | |
download | external_llvm-f49be7c96f5a57ba67e6b1dc4362273b5f7cbd81.zip external_llvm-f49be7c96f5a57ba67e6b1dc4362273b5f7cbd81.tar.gz external_llvm-f49be7c96f5a57ba67e6b1dc4362273b5f7cbd81.tar.bz2 |
Make sure the LR gets pushed in functions that use vaargs. This fixes
400.perlbench for the nightly tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98183 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/ARM/ARMBaseRegisterInfo.cpp')
-rw-r--r-- | lib/Target/ARM/ARMBaseRegisterInfo.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Target/ARM/ARMBaseRegisterInfo.cpp b/lib/Target/ARM/ARMBaseRegisterInfo.cpp index d9b8323..11e1c48 100644 --- a/lib/Target/ARM/ARMBaseRegisterInfo.cpp +++ b/lib/Target/ARM/ARMBaseRegisterInfo.cpp @@ -590,6 +590,10 @@ ARMBaseRegisterInfo::processFunctionBeforeCalleeSavedScan(MachineFunction &MF, AFI->isThumb2Function()) MF.getRegInfo().setPhysRegUsed(ARM::R4); + // Spill LR if Thumb1 function uses variable length argument lists. + if (AFI->isThumb1OnlyFunction() && AFI->getVarArgsRegSaveSize() > 0) + MF.getRegInfo().setPhysRegUsed(ARM::LR); + // Don't spill FP if the frame can be eliminated. This is determined // by scanning the callee-save registers to see if any is used. const unsigned *CSRegs = getCalleeSavedRegs(); |