[llvm-branch-commits] [llvm-branch] r98184 - in /llvm/branches/Apple/Hermes/lib/Target/ARM: ARMBaseRegisterInfo.cpp Thumb1RegisterInfo.cpp

Jim Grosbach grosbach at apple.com
Wed Mar 10 12:03:09 PST 2010


Author: grosbach
Date: Wed Mar 10 14:03:08 2010
New Revision: 98184

URL: http://llvm.org/viewvc/llvm-project?rev=98184&view=rev
Log:
merge 98182 98183

Modified:
    llvm/branches/Apple/Hermes/lib/Target/ARM/ARMBaseRegisterInfo.cpp
    llvm/branches/Apple/Hermes/lib/Target/ARM/Thumb1RegisterInfo.cpp

Modified: llvm/branches/Apple/Hermes/lib/Target/ARM/ARMBaseRegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Hermes/lib/Target/ARM/ARMBaseRegisterInfo.cpp?rev=98184&r1=98183&r2=98184&view=diff
==============================================================================
--- llvm/branches/Apple/Hermes/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original)
+++ llvm/branches/Apple/Hermes/lib/Target/ARM/ARMBaseRegisterInfo.cpp Wed Mar 10 14:03:08 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();

Modified: llvm/branches/Apple/Hermes/lib/Target/ARM/Thumb1RegisterInfo.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/Apple/Hermes/lib/Target/ARM/Thumb1RegisterInfo.cpp?rev=98184&r1=98183&r2=98184&view=diff
==============================================================================
--- llvm/branches/Apple/Hermes/lib/Target/ARM/Thumb1RegisterInfo.cpp (original)
+++ llvm/branches/Apple/Hermes/lib/Target/ARM/Thumb1RegisterInfo.cpp Wed Mar 10 14:03:08 2010
@@ -854,6 +854,11 @@
   }
 
   if (VARegSaveSize) {
+    // Unlike T2 and ARM mode, the T1 pop instruction cannot restore
+    // to LR, and we can't pop the value directly to the PC since
+    // we need to update the SP after popping the value. Therefore, we
+    // pop the old LR into R3 as a temporary.
+
     // Move back past the callee-saved register restoration
     while (MBBI != MBB.end() && isCSRestore(MBBI, CSRegs))
       ++MBBI;





More information about the llvm-branch-commits mailing list