[llvm-commits] [llvm] r98183 - /llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
Jim Grosbach
grosbach at apple.com
Wed Mar 10 12:01:30 PST 2010
Author: grosbach
Date: Wed Mar 10 14:01:30 2010
New Revision: 98183
URL: http://llvm.org/viewvc/llvm-project?rev=98183&view=rev
Log:
Make sure the LR gets pushed in functions that use vaargs. This fixes
400.perlbench for the nightly tests.
Modified:
llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
Modified: llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=98183&r1=98182&r2=98183&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Wed Mar 10 14:01:30 2010
@@ -590,6 +590,10 @@
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();
More information about the llvm-commits
mailing list