[WinEH] Simplify unreachable catchpads
authorJoseph Tremoulet <jotrem@microsoft.com>
Tue, 5 Jan 2016 02:37:41 +0000 (02:37 +0000)
committerJoseph Tremoulet <jotrem@microsoft.com>
Tue, 5 Jan 2016 02:37:41 +0000 (02:37 +0000)
commitd28c1bc303cdffe04b9433bb3757e331f6e250af
tree7c191c4d81dc2553be75025ac0844c6d16b5da13
parent7f4aa70ca5194c85f162a0d040e939b69460bb69
[WinEH] Simplify unreachable catchpads

Summary:
At least for CoreCLR, a catchpad which immediately executes an
`unreachable` instruction indicates that the exception can never have a
matching type, and so such catchpads can be removed, and so can their
catchswitches if the catchswitch becomes empty.

Reviewers: rnk, andrew.w.kaylor, majnemer

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256809 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/IR/Instructions.h
lib/IR/Instructions.cpp
lib/Transforms/Utils/SimplifyCFG.cpp
test/Transforms/SimplifyCFG/empty-catchpad.ll [new file with mode: 0644]