X86: Fix frameescape when not using an FP

We can't use TargetFrameLowering::getFrameIndexOffset directly, because
Win64 really wants the offset from the stack pointer at the end of the
prologue. Instead, use X86FrameLowering::getFrameIndexOffsetFromSP(),
which is a pretty close approximiation of that. It fails to handle cases
with interestingly large stack alignments, which is pretty uncommon on
Win64 and is TODO.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233137 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Reid Kleckner
2015-03-24 23:46:01 +00:00
parent fa71fb34ad
commit d639e1975d
3 changed files with 84 additions and 37 deletions

View File

@ -584,14 +584,6 @@ int MachineFrameInfo::CreateFixedSpillStackObject(uint64_t Size,
return -++NumFixedObjects;
}
int MachineFrameInfo::CreateFrameAllocation(uint64_t Size) {
// Force the use of a frame pointer. The intention is that this intrinsic be
// used in conjunction with unwind mechanisms that leak the frame pointer.
setFrameAddressIsTaken(true);
Size = RoundUpToAlignment(Size, StackAlignment);
return CreateStackObject(Size, StackAlignment, false);
}
BitVector
MachineFrameInfo::getPristineRegs(const MachineBasicBlock *MBB) const {
assert(MBB && "MBB must be valid");