[WinEH] Make llvm.x86.seh.restoreframe work for stack realignment prologues
authorReid Kleckner <reid@kleckner.net>
Tue, 7 Jul 2015 23:45:58 +0000 (23:45 +0000)
committerReid Kleckner <reid@kleckner.net>
Tue, 7 Jul 2015 23:45:58 +0000 (23:45 +0000)
commit39ee70ca76f31e3448db185ec18b4fa085ecc1df
tree9affb45ffcd3e2e2ec3705992a4dc61cff4d6159
parentc845b4d7be1ed8cc9eaa60b171804f2435e71fec
[WinEH] Make llvm.x86.seh.restoreframe work for stack realignment prologues

The incoming EBP value points to the end of a local stack allocation, so
we can use that to restore ESI, the base pointer. Once we do that, we
can use local stack allocations. If we know we need stack realignment,
spill the original frame pointer in the prologue and reload it after
restoring ESI.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241648 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/CodeGen/MachineFrameInfo.h
lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
lib/Target/X86/X86FrameLowering.cpp
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86MachineFunctionInfo.h
lib/Target/X86/X86RegisterInfo.cpp
lib/Target/X86/X86SelectionDAGInfo.cpp
test/CodeGen/X86/seh-stack-realign-win32.ll [new file with mode: 0644]