X86: Explain why we cannot use a 'mov' in a Win64 epilogue

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@230268 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
David Majnemer 2015-02-23 21:50:25 +00:00
parent 10c4458d7d
commit 16ae406776

View File

@ -1048,6 +1048,12 @@ void X86FrameLowering::emitEpilogue(MachineFunction &MF,
if (RegInfo->needsStackRealignment(MF))
MBBI = FirstCSPop;
if (IsWinEH) {
// There are only two legal forms of epilogue:
// - add SEHAllocationSize, %rsp
// - lea SEHAllocationSize(%FramePtr), %rsp
//
// We are *not* permitted to use 'mov %FramePtr, %rsp' because the Win64
// unwinder will not recognize 'mov' as an epilogue instruction.
unsigned SEHFrameOffset = calculateSetFPREG(SEHStackAllocAmt);
addRegOffset(BuildMI(MBB, MBBI, DL, TII.get(X86::LEA64r), StackPtr),
FramePtr, false, SEHStackAllocAmt - SEHFrameOffset);