forked from OSchip/llvm-project
[WebAssembly] Make rethrow instruction take a target BB argument
Summary: This patch changes the rethrow instruction to take a BB argument in LLVM backend, like `br` and `br_if`s. This BB is a target catch BB the rethrow instruction unwinds to. This BB argument will be converted to an relative depth immediate at the end of CFGStackify pass, as in the same way of branches. RETHROW_TO_CALLER is a codegen-only instruction that should be used when a rethrow instruction does not have an unwind destination BB, i.e., it should rethrow to its caller function. Reviewers: dschuff Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D48260 llvm-svn: 334998
This commit is contained in:
parent
56e1271020
commit
6279d71227
|
@ -152,8 +152,11 @@ defm THROW_I64 : I<(outs), (ins i32imm:$tag, I64:$val),
|
||||||
[(int_wasm_throw imm:$tag, I64:$val)],
|
[(int_wasm_throw imm:$tag, I64:$val)],
|
||||||
"throw \t$tag, $val", "throw \t$tag",
|
"throw \t$tag, $val", "throw \t$tag",
|
||||||
0x08>;
|
0x08>;
|
||||||
defm RETHROW : NRI<(outs), (ins i32imm:$rel_depth), [], "rethrow \t$rel_depth",
|
defm RETHROW : NRI<(outs), (ins bb_op:$dst), [], "rethrow \t$dst", 0x09>;
|
||||||
0x09>;
|
let isCodeGenOnly = 1 in
|
||||||
|
// This is used when the destination for rethrow is the caller function. This
|
||||||
|
// will be converted to a rethrow in CFGStackify.
|
||||||
|
defm RETHROW_TO_CALLER : NRI<(outs), (ins), [], "rethrow">;
|
||||||
} // isTerminator = 1, hasCtrlDep = 1, isBarrier = 1
|
} // isTerminator = 1, hasCtrlDep = 1, isBarrier = 1
|
||||||
|
|
||||||
// Region within which an exception is caught: try / end_try
|
// Region within which an exception is caught: try / end_try
|
||||||
|
|
Loading…
Reference in New Issue