[llvm-commits] [llvm] r83136 - /llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp

Jim Grosbach grosbach at apple.com
Tue Sep 29 18:43:29 PDT 2009


Author: grosbach
Date: Tue Sep 29 20:43:29 2009
New Revision: 83136

URL: http://llvm.org/viewvc/llvm-project?rev=83136&view=rev
Log:
When checking whether we need to reserve a register for the scavenger,
the size of the saved frame pointer needs to be taken into account.

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=83136&r1=83135&r2=83136&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Tue Sep 29 20:43:29 2009
@@ -654,7 +654,13 @@
     // adjustments also, even when the frame itself is small.
     if (RS && !ExtraCSSpill) {
       MachineFrameInfo  *MFI = MF.getFrameInfo();
-      if (estimateStackSize(MF, MFI) >= estimateRSStackSizeLimit(MF)
+      // If any of the stack slot references may be out of range of an
+      // immediate offset, make sure a register (or a spill slot) is
+      // available for the register scavenger. Note that if we're indexing
+      // off the frame pointer, the effective stack size is 4 bytes larger
+      // since the FP points to the previous FP.
+      if (estimateStackSize(MF, MFI) + (hasFP(MF) ? 4 : 0)
+          >= estimateRSStackSizeLimit(MF)
           || AFI->isThumb1OnlyFunction()) {
         // If any non-reserved CS register isn't spilled, just spill one or two
         // extra. That should take care of it!





More information about the llvm-commits mailing list