[WinEH] Demote values and phis live across exception handlers up front
authorReid Kleckner <reid@kleckner.net>
Wed, 22 Apr 2015 21:05:21 +0000 (21:05 +0000)
committerReid Kleckner <reid@kleckner.net>
Wed, 22 Apr 2015 21:05:21 +0000 (21:05 +0000)
commitfd7df284b801bd37af68f1f1a9e0b23c37744d47
tree2944a5c2fcf6c4ae69e37bc0eb619c276a00438a
parentfe58d13a17a2824fe891274e1396e5fc1ca5ab38
[WinEH] Demote values and phis live across exception handlers up front

In particular, this handles SSA values that are live *out* of a handler.
The existing code only handles values that are live *in* to a handler.

It also handles phi nodes in the block where normal control should
resume after the end of a catch handler.  When EH return points have phi
nodes, we need to split the return edge. It is impossible for phi
elimination to emit copies in the previous block if that block gets
outlined. The indirectbr that we leave in the function is only notional,
and is eliminated from the MachineFunction CFG early on.

Reviewers: majnemer, andrew.w.kaylor

Differential Revision: http://reviews.llvm.org/D9158

llvm-svn: 235545
llvm/lib/CodeGen/WinEHPrepare.cpp
llvm/test/CodeGen/WinEH/cppeh-demote-liveout.ll [new file with mode: 0644]
llvm/test/CodeGen/WinEH/cppeh-inalloca.ll
llvm/test/CodeGen/WinEH/cppeh-multi-catch.ll
llvm/test/CodeGen/WinEH/cppeh-nonalloca-frame-values.ll
llvm/test/CodeGen/WinEH/seh-simple.ll