[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)
commitde3495610db73d6a7a17ed5d41f9b7c4754a1370
treeaea81336c6654477ba7f3b7d45af38042bd31217
parent3bd87826e5a29b3d4870287bc16d03c52c451be8
[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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235545 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/WinEHPrepare.cpp
test/CodeGen/WinEH/cppeh-demote-liveout.ll [new file with mode: 0644]
test/CodeGen/WinEH/cppeh-inalloca.ll
test/CodeGen/WinEH/cppeh-multi-catch.ll
test/CodeGen/WinEH/cppeh-nonalloca-frame-values.ll
test/CodeGen/WinEH/seh-simple.ll