Make sure the LR gets pushed in functions that use vaargs. This fixes

400.perlbench for the nightly tests.

llvm-svn: 98183
This commit is contained in:
Jim Grosbach 2010-03-10 20:01:30 +00:00
parent 77f781405d
commit f0a7e8e77d
1 changed files with 4 additions and 0 deletions

View File

@ -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();