[WebAssembly] Remove unnecessary instructions after TRY marker placement
authorHeejin Ahn <aheejin@gmail.com>
Wed, 27 Feb 2019 00:50:53 +0000 (00:50 +0000)
committerHeejin Ahn <aheejin@gmail.com>
Wed, 27 Feb 2019 00:50:53 +0000 (00:50 +0000)
commitcf699b4534e6e0285d1a6899b5237c5fd9100ab7
tree3b2da62357bb85f10548932a310ae5a1153bda67
parent6d6288ae977bfdb08dc2b731f34d9b1ebfc68748
[WebAssembly] Remove unnecessary instructions after TRY marker placement

Summary:
This removes unnecessary instructions after TRY marker placement. There
are two cases:
- `end`/`end_block` can be removed if they overlap with `try`/`end_try`
  and they have the same return types.
- `br` right before `catch` that branches to after `end_try` can be
  deleted.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D58591

llvm-svn: 354939
llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp
llvm/test/CodeGen/WebAssembly/cfg-stackify-eh.ll
llvm/test/CodeGen/WebAssembly/exception.ll