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

Bob Wilson bob.wilson at apple.com
Fri Sep 25 09:34:46 PDT 2009


Author: bwilson
Date: Fri Sep 25 11:34:46 2009
New Revision: 82773

URL: http://llvm.org/viewvc/llvm-project?rev=82773&view=rev
Log:
Add some comments to clarify things that I discovered this week.

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=82773&r1=82772&r2=82773&view=diff

==============================================================================
--- llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp (original)
+++ llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp Fri Sep 25 11:34:46 2009
@@ -1151,6 +1151,7 @@
   unsigned GPRCS1Size = 0, GPRCS2Size = 0, DPRCSSize = 0;
   int FramePtrSpillFI = 0;
 
+  // Allocate the vararg register save area. This is not counted in NumBytes.
   if (VARegSaveSize)
     emitSPUpdate(isARM, MBB, MBBI, dl, TII, -VARegSaveSize);
 
@@ -1198,8 +1199,11 @@
   emitSPUpdate(isARM, MBB, MBBI, dl, TII, -GPRCS1Size);
   movePastCSLoadStoreOps(MBB, MBBI, ARM::STR, ARM::t2STRi12, 1, STI);
 
-  // Darwin ABI requires FP to point to the stack slot that contains the
-  // previous FP.
+  // Set FP to point to the stack slot that contains the previous FP.
+  // For Darwin, FP is R7, which has now been stored in spill area 1.
+  // Otherwise, if this is not Darwin, all the callee-saved registers go
+  // into spill area 1, including the FP in R11.  In either case, it is
+  // now safe to emit this assignment.
   if (STI.isTargetDarwin() || hasFP(MF)) {
     unsigned ADDriOpc = !AFI->isThumbFunction() ? ARM::ADDri : ARM::t2ADDri;
     MachineInstrBuilder MIB =





More information about the llvm-commits mailing list