llvm.org GIT mirror llvm / c6e497a
[WebAssembly] Gather EH instructions in one place. NFC. Summary: - Gather EH instructions in one place for easy tracking (more will be added later) - Variable name change Reviewers: dschuff Subscribers: jfb, sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D43742 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@326522 91177308-0d34-0410-b5e6-96231b3b80d8 Heejin Ahn 2 years ago
1 changed file(s) with 20 addition(s) and 10 deletion(s). Raw diff Collapse all Expand all
5656 }
5757 } // isTerminator = 1, hasCtrlDep = 1, isBarrier = 1
5858
59 // Placemarkers to indicate the start or end of a block, loop, or try scope.
59 // Placemarkers to indicate the start or end of a block or loop scope.
6060 // These use/clobber VALUE_STACK to prevent them from being moved into the
6161 // middle of an expression tree.
6262 let Uses = [VALUE_STACK], Defs = [VALUE_STACK] in {
6363 def BLOCK : I<(outs), (ins Signature:$sig), [], "block \t$sig", 0x02>;
6464 def LOOP : I<(outs), (ins Signature:$sig), [], "loop \t$sig", 0x03>;
65 def TRY : I<(outs), (ins Signature:$sig), [], "try \t$sig", 0x06>;
6665
67 // END_BLOCK, END_LOOP, END_TRY, and END_FUNCTION are represented with the same
68 // opcode in wasm.
66 // END_BLOCK, END_LOOP, and END_FUNCTION are represented with the same opcode in
67 // wasm.
6968 def END_BLOCK : I<(outs), (ins), [], "end_block", 0x0b>;
7069 def END_LOOP : I<(outs), (ins), [], "end_loop", 0x0b>;
71 def END_TRY : I<(outs), (ins), [], "end_try", 0x0b>;
7270 let isTerminator = 1, isBarrier = 1 in
7371 def END_FUNCTION : I<(outs), (ins), [], "end_function", 0x0b>;
7472 } // Uses = [VALUE_STACK], Defs = [VALUE_STACK]
112110 } // isReturn = 1
113111
114112 def UNREACHABLE : I<(outs), (ins), [(trap)], "unreachable", 0x00>;
113 } // isTerminator = 1, hasCtrlDep = 1, isBarrier = 1
115114
116 def THROW_I32 : I<(outs), (ins i32imm:$tag, I32:$obj),
117 [(int_wasm_throw imm:$tag, I32:$obj)], "throw \t$tag, $obj",
115 //===----------------------------------------------------------------------===//
116 // Exception handling instructions
117 //===----------------------------------------------------------------------===//
118
119 // Throwing an exception: throw / rethrow
120 let isTerminator = 1, hasCtrlDep = 1, isBarrier = 1 in {
121 def THROW_I32 : I<(outs), (ins i32imm:$tag, I32:$val),
122 [(int_wasm_throw imm:$tag, I32:$val)], "throw \t$tag, $val",
118123 0x08>;
119 def THROW_I64 : I<(outs), (ins i32imm:$tag, I64:$obj),
120 [(int_wasm_throw imm:$tag, I64:$obj)], "throw \t$tag, $obj",
124 def THROW_I64 : I<(outs), (ins i32imm:$tag, I64:$val),
125 [(int_wasm_throw imm:$tag, I64:$val)], "throw \t$tag, $val",
121126 0x08>;
122127 def RETHROW : I<(outs), (ins i32imm:$rel_depth), [], "rethrow \t$rel_depth",
123128 0x09>;
129 } // isTerminator = 1, hasCtrlDep = 1, isBarrier = 1
124130
125 } // isTerminator = 1, hasCtrlDep = 1, isBarrier = 1
131 // Region within which an exception is caught: try / end_try
132 let Uses = [VALUE_STACK], Defs = [VALUE_STACK] in {
133 def TRY : I<(outs), (ins Signature:$sig), [], "try \t$sig", 0x06>;
134 def END_TRY : I<(outs), (ins), [], "end_try", 0x0b>;
135 } // Uses = [VALUE_STACK], Defs = [VALUE_STACK]
126136
127137 } // Defs = [ARGUMENTS]
128138