diff options
author | Reid Kleckner <rnk@google.com> | 2015-11-05 21:09:49 +0000 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2015-11-05 21:09:49 +0000 |
commit | 6ddae31045615b4f4e7005427d013e525b73bbd3 (patch) | |
tree | b35d4146ff258ef80cc66b23a0f035679516fd9f /llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | |
parent | 484e48e3a3107c8b9827824fc40d5e644e79bf97 (diff) | |
download | bcm5719-llvm-6ddae31045615b4f4e7005427d013e525b73bbd3.tar.gz bcm5719-llvm-6ddae31045615b4f4e7005427d013e525b73bbd3.zip |
[WinEH] Fix funclet prologues with stack realignment
We already had a test for this for 32-bit SEH catchpads, but those don't
actually create funclets. We had a bug that only appeared in funclet
prologues, where we would establish EBP and ESI as our FP and BP, and
then downstream prologue code would overwrite them.
While I was at it, I fixed Win64+funclets+stackrealign. This issue
doesn't come up as often there due to the ABI requring 16 byte stack
alignment, but now we can rest easy that AVX and WinEH will work well
together =P.
llvm-svn: 252210
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp index c3744f7494f..52216c2c1e8 100644 --- a/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp @@ -215,10 +215,14 @@ void FunctionLoweringInfo::set(const Function &fn, MachineFunction &mf, // are really data, and no instructions can live here. if (BB->isEHPad()) { const Instruction *I = BB->getFirstNonPHI(); - // FIXME: Don't mark SEH functions without __finally blocks as having + // If this is a non-landingpad EH pad, mark this function as using // funclets. - if (!isa<LandingPadInst>(I)) + // FIXME: SEH catchpads do not create funclets, so we could avoid setting + // this in such cases in order to improve frame layout. + if (!isa<LandingPadInst>(I)) { MMI.setHasEHFunclets(true); + MF->getFrameInfo()->setHasOpaqueSPAdjustment(true); + } if (isa<CatchEndPadInst>(I) || isa<CleanupEndPadInst>(I)) { assert(&*BB->begin() == I && "WinEHPrepare failed to remove PHIs from imaginary BBs"); |