// There is alloca()'s in this function, must reference off the frame
// pointer instead.
FrameReg = getFrameRegister(MF);
- if (STI.isTargetDarwin())
- Offset -= AFI->getFramePtrSpillOffset();
+ Offset -= AFI->getFramePtrSpillOffset();
}
unsigned Opcode = MI.getOpcode();
}
}
+ if (hasFP(MF)) {
+ MF.changePhyRegUsed(FramePtr, true);
+ NumGPRSpills++;
+ CanEliminateFrame = false;
+ }
+
if (!CanEliminateFrame) {
AFI->setHasStackFrame(true);
ForceLRSpill = false;
}
- if (STI.isTargetDarwin()) {
- MF.changePhyRegUsed(FramePtr, true);
- NumGPRSpills++;
- }
-
// If stack and double are 8-byte aligned and we are spilling an odd number
// of GPRs. Spill one extra callee save GPR so we won't have to pad between
// the integer and double callee save areas.
++MBBI;
// Point FP to the stack slot that contains the previous FP.
- if (STI.isTargetDarwin())
+ if (hasFP(MF))
BuildMI(MBB, MBBI, TII.get(isThumb ? ARM::tADDrSPi : ARM::ADDri), FramePtr)
.addFrameIndex(FramePtrSpillFI).addImm(0);
if (isThumb)
emitSPUpdate(MBB, MBBI, NumBytes, isThumb, TII);
else {
- if (STI.isTargetDarwin()) {
+ if (hasFP(MF)){
NumBytes = AFI->getFramePtrSpillOffset() - NumBytes;
// Reset SP based on frame pointer only if the stack frame extends beyond
// frame pointer stack slot.
} else if (NumBytes) {
emitSPUpdate(MBB, MBBI, NumBytes, false, TII);
}
-
// Move SP to start of integer callee save spill area 2.
movePastCSLoadStoreOps(MBB, MBBI, ARM::FLDD, 3, STI);
emitSPUpdate(MBB, MBBI, AFI->getDPRCalleeSavedAreaSize(), false, TII);
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldmia" | wc -l | grep 2 &&
; RUN: llvm-upgrade < %s | llvm-as | llc -march=arm | grep "ldmib" | wc -l | grep 1 &&
-; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin | grep "ldmfd sp\!" | wc -l | grep 3
+; RUN: llvm-upgrade < %s | llvm-as | llc -mtriple=arm-apple-darwin --disable-fp-elim | grep "ldmfd sp\!" | wc -l | grep 3
%X = external global [0 x int]