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

Jim Grosbach grosbach at apple.com
Tue Aug 31 11:52:31 PDT 2010


Author: grosbach
Date: Tue Aug 31 13:52:31 2010
New Revision: 112624

URL: http://llvm.org/viewvc/llvm-project?rev=112624&view=rev
Log:
SP relative offsets need to be adjusted by the local allocation size when
determining if they're likely to be in range of the SP when resolving
frame references.

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=112624&r1=112623&r2=112624&view=diff
==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Tue Aug 31 13:52:31 2010
@@ -1480,7 +1480,11 @@
   if (!AFI->isThumbFunction() || !AFI->isThumb1OnlyFunction())
     FPOffset -= 80;
   // Estimate an offset from the stack pointer.
+  // The incoming offset is relating to the SP at the start of the function,
+  // but when we access the local it'll be relative to the SP after local
+  // allocation, so adjust our SP-relative offset by that allocation size.
   Offset = -Offset;
+  Offset += MFI->getLocalFrameSize();
   // Assume that we'll have at least some spill slots allocated.
   // FIXME: This is a total SWAG number. We should run some statistics
   //        and pick a real one.





More information about the llvm-commits mailing list