[llvm-commits] [llvm] r83136 - /llvm/trunk/lib/Target/ARM/ARMBaseRegisterInfo.cpp
Evan Cheng
evan.cheng at apple.com
Wed Sep 30 01:10:26 PDT 2009
On Sep 29, 2009, at 6:43 PM, Jim Grosbach wrote:
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- 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)
In processFunctionBeforeCalleeSavedScan:
// Darwin ABI requires FP to point to the stack slot that
contains the
// previous FP.
if (STI.isTargetDarwin() || hasFP(MF)) {
MF.getRegInfo().setPhysRegUsed(FramePtr);
NumGPRSpills++;
}
So if it's Darwin it spills fp even if hasFP is false (unless the
function is frameless). Also FP points to the slot that contains
previous FP. It's not "FP points to the previous FP". Is the
adjustment 4 always right?
Evan
> || AFI->isThumb1OnlyFunction()) {
> // If any non-reserved CS register isn't spilled, just spill
> one or two
> // extra. That should take care of it!
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list