[WebAssembly] Delete ThrowUnwindDest map from WasmEHFuncInfo
authorHeejin Ahn <aheejin@gmail.com>
Sun, 3 Mar 2019 22:35:56 +0000 (22:35 +0000)
committerHeejin Ahn <aheejin@gmail.com>
Sun, 3 Mar 2019 22:35:56 +0000 (22:35 +0000)
commit195a62e9ae50594e469398631a24f4bc26061c56
treeb6300c14bf840459ffd9c4878158386305358345
parente9e4a0f5b48aed30669e731d3f54f96fd1dacff0
[WebAssembly] Delete ThrowUnwindDest map from WasmEHFuncInfo

Summary:
Before when we implemented the first EH proposal, 'catch <tag>'
instruction may not catch an exception so there were multiple EH pads an
exception can unwind to. That means a BB could have multiple EH pad
successors.

Now after we switched to the new proposal, every 'catch' instruction
catches an exception, and there is only one catchpad per catchswitch, so
we at most have one EH pad successor, making `ThrowUnwindDest` map in
`WasmEHInfo` unnecessary.

Keeping `ThrowUnwindDest` map in `WasmEHInfo` has its own problems,
because other optimization passes can split a BB that contains possibly
throwing calls (previously invokes), and we have to update the map every
time that happens, which is not easy for common CodeGen passes.

This also correctly updates successor info in LateEHPrepare when we add
a rethrow instruction.

Reviewers: dschuff

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

Tags: #llvm

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

llvm-svn: 355296
llvm/include/llvm/CodeGen/WasmEHFuncInfo.h
llvm/lib/CodeGen/SelectionDAG/FunctionLoweringInfo.cpp
llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
llvm/lib/CodeGen/WasmEHPrepare.cpp
llvm/lib/Target/WebAssembly/WebAssemblyLateEHPrepare.cpp
llvm/test/CodeGen/WebAssembly/cfg-stackify-eh.ll