26 "_Unwind_Wasm_CallPersonality";
30 case WebAssembly::ARGUMENT_i32:
31 case WebAssembly::ARGUMENT_i32_S:
32 case WebAssembly::ARGUMENT_i64:
33 case WebAssembly::ARGUMENT_i64_S:
34 case WebAssembly::ARGUMENT_f32:
35 case WebAssembly::ARGUMENT_f32_S:
36 case WebAssembly::ARGUMENT_f64:
37 case WebAssembly::ARGUMENT_f64_S:
38 case WebAssembly::ARGUMENT_v16i8:
39 case WebAssembly::ARGUMENT_v16i8_S:
40 case WebAssembly::ARGUMENT_v8i16:
41 case WebAssembly::ARGUMENT_v8i16_S:
42 case WebAssembly::ARGUMENT_v4i32:
43 case WebAssembly::ARGUMENT_v4i32_S:
44 case WebAssembly::ARGUMENT_v2i64:
45 case WebAssembly::ARGUMENT_v2i64_S:
46 case WebAssembly::ARGUMENT_v4f32:
47 case WebAssembly::ARGUMENT_v4f32_S:
48 case WebAssembly::ARGUMENT_v2f64:
49 case WebAssembly::ARGUMENT_v2f64_S:
58 case WebAssembly::COPY_I32:
59 case WebAssembly::COPY_I32_S:
60 case WebAssembly::COPY_I64:
61 case WebAssembly::COPY_I64_S:
62 case WebAssembly::COPY_F32:
63 case WebAssembly::COPY_F32_S:
64 case WebAssembly::COPY_F64:
65 case WebAssembly::COPY_F64_S:
66 case WebAssembly::COPY_V128:
67 case WebAssembly::COPY_V128_S:
76 case WebAssembly::TEE_I32:
77 case WebAssembly::TEE_I32_S:
78 case WebAssembly::TEE_I64:
79 case WebAssembly::TEE_I64_S:
80 case WebAssembly::TEE_F32:
81 case WebAssembly::TEE_F32_S:
82 case WebAssembly::TEE_F64:
83 case WebAssembly::TEE_F64_S:
84 case WebAssembly::TEE_V128:
85 case WebAssembly::TEE_V128_S:
107 case WebAssembly::CALL_VOID:
108 case WebAssembly::CALL_VOID_S:
109 case WebAssembly::CALL_I32:
110 case WebAssembly::CALL_I32_S:
111 case WebAssembly::CALL_I64:
112 case WebAssembly::CALL_I64_S:
113 case WebAssembly::CALL_F32:
114 case WebAssembly::CALL_F32_S:
115 case WebAssembly::CALL_F64:
116 case WebAssembly::CALL_F64_S:
117 case WebAssembly::CALL_v16i8:
118 case WebAssembly::CALL_v16i8_S:
119 case WebAssembly::CALL_v8i16:
120 case WebAssembly::CALL_v8i16_S:
121 case WebAssembly::CALL_v4i32:
122 case WebAssembly::CALL_v4i32_S:
123 case WebAssembly::CALL_v2i64:
124 case WebAssembly::CALL_v2i64_S:
125 case WebAssembly::CALL_v4f32:
126 case WebAssembly::CALL_v4f32_S:
127 case WebAssembly::CALL_v2f64:
128 case WebAssembly::CALL_v2f64_S:
129 case WebAssembly::CALL_EXCEPT_REF:
130 case WebAssembly::CALL_EXCEPT_REF_S:
139 case WebAssembly::CALL_INDIRECT_VOID:
140 case WebAssembly::CALL_INDIRECT_VOID_S:
141 case WebAssembly::CALL_INDIRECT_I32:
142 case WebAssembly::CALL_INDIRECT_I32_S:
143 case WebAssembly::CALL_INDIRECT_I64:
144 case WebAssembly::CALL_INDIRECT_I64_S:
145 case WebAssembly::CALL_INDIRECT_F32:
146 case WebAssembly::CALL_INDIRECT_F32_S:
147 case WebAssembly::CALL_INDIRECT_F64:
148 case WebAssembly::CALL_INDIRECT_F64_S:
149 case WebAssembly::CALL_INDIRECT_v16i8:
150 case WebAssembly::CALL_INDIRECT_v16i8_S:
151 case WebAssembly::CALL_INDIRECT_v8i16:
152 case WebAssembly::CALL_INDIRECT_v8i16_S:
153 case WebAssembly::CALL_INDIRECT_v4i32:
154 case WebAssembly::CALL_INDIRECT_v4i32_S:
155 case WebAssembly::CALL_INDIRECT_v2i64:
156 case WebAssembly::CALL_INDIRECT_v2i64_S:
157 case WebAssembly::CALL_INDIRECT_v4f32:
158 case WebAssembly::CALL_INDIRECT_v4f32_S:
159 case WebAssembly::CALL_INDIRECT_v2f64:
160 case WebAssembly::CALL_INDIRECT_v2f64_S:
161 case WebAssembly::CALL_INDIRECT_EXCEPT_REF:
162 case WebAssembly::CALL_INDIRECT_EXCEPT_REF_S:
171 case WebAssembly::CALL_VOID:
172 case WebAssembly::CALL_VOID_S:
173 case WebAssembly::CALL_INDIRECT_VOID:
174 case WebAssembly::CALL_INDIRECT_VOID_S:
176 case WebAssembly::CALL_I32:
177 case WebAssembly::CALL_I32_S:
178 case WebAssembly::CALL_I64:
179 case WebAssembly::CALL_I64_S:
180 case WebAssembly::CALL_F32:
181 case WebAssembly::CALL_F32_S:
182 case WebAssembly::CALL_F64:
183 case WebAssembly::CALL_F64_S:
184 case WebAssembly::CALL_v16i8:
185 case WebAssembly::CALL_v16i8_S:
186 case WebAssembly::CALL_v8i16:
187 case WebAssembly::CALL_v8i16_S:
188 case WebAssembly::CALL_v4i32:
189 case WebAssembly::CALL_v4i32_S:
190 case WebAssembly::CALL_v2i64:
191 case WebAssembly::CALL_v2i64_S:
192 case WebAssembly::CALL_v4f32:
193 case WebAssembly::CALL_v4f32_S:
194 case WebAssembly::CALL_v2f64:
195 case WebAssembly::CALL_v2f64_S:
196 case WebAssembly::CALL_EXCEPT_REF:
197 case WebAssembly::CALL_EXCEPT_REF_S:
198 case WebAssembly::CALL_INDIRECT_I32:
199 case WebAssembly::CALL_INDIRECT_I32_S:
200 case WebAssembly::CALL_INDIRECT_I64:
201 case WebAssembly::CALL_INDIRECT_I64_S:
202 case WebAssembly::CALL_INDIRECT_F32:
203 case WebAssembly::CALL_INDIRECT_F32_S:
204 case WebAssembly::CALL_INDIRECT_F64:
205 case WebAssembly::CALL_INDIRECT_F64_S:
206 case WebAssembly::CALL_INDIRECT_v16i8:
207 case WebAssembly::CALL_INDIRECT_v16i8_S:
208 case WebAssembly::CALL_INDIRECT_v8i16:
209 case WebAssembly::CALL_INDIRECT_v8i16_S:
210 case WebAssembly::CALL_INDIRECT_v4i32:
211 case WebAssembly::CALL_INDIRECT_v4i32_S:
212 case WebAssembly::CALL_INDIRECT_v2i64:
213 case WebAssembly::CALL_INDIRECT_v2i64_S:
214 case WebAssembly::CALL_INDIRECT_v4f32:
215 case WebAssembly::CALL_INDIRECT_v4f32_S:
216 case WebAssembly::CALL_INDIRECT_v2f64:
217 case WebAssembly::CALL_INDIRECT_v2f64_S:
218 case WebAssembly::CALL_INDIRECT_EXCEPT_REF:
219 case WebAssembly::CALL_INDIRECT_EXCEPT_REF_S:
228 case WebAssembly::BLOCK:
229 case WebAssembly::BLOCK_S:
231 case WebAssembly::END_BLOCK_S:
233 case WebAssembly::LOOP_S:
234 case WebAssembly::END_LOOP:
235 case WebAssembly::END_LOOP_S:
236 case WebAssembly::TRY:
237 case WebAssembly::TRY_S:
238 case WebAssembly::END_TRY:
239 case WebAssembly::END_TRY_S:
248 case WebAssembly::THROW_I32:
249 case WebAssembly::THROW_I32_S:
250 case WebAssembly::THROW_I64:
251 case WebAssembly::THROW_I64_S:
260 case WebAssembly::RETHROW:
261 case WebAssembly::RETHROW_S:
262 case WebAssembly::RETHROW_TO_CALLER:
263 case WebAssembly::RETHROW_TO_CALLER_S:
272 case WebAssembly::CATCH_I32:
273 case WebAssembly::CATCH_I32_S:
274 case WebAssembly::CATCH_I64:
275 case WebAssembly::CATCH_I64_S:
276 case WebAssembly::CATCH_ALL:
277 case WebAssembly::CATCH_ALL_S:
286 case WebAssembly::THROW_I32:
287 case WebAssembly::THROW_I32_S:
288 case WebAssembly::THROW_I64:
289 case WebAssembly::THROW_I64_S:
290 case WebAssembly::RETHROW:
291 case WebAssembly::RETHROW_S:
304 if (F->doesNotThrow())
316 bool SeenCatch =
false;
317 for (
auto &
MI : MBB) {
318 if (
MI.getOpcode() == WebAssembly::CATCH_I32 ||
319 MI.getOpcode() == WebAssembly::CATCH_I64 ||
320 MI.getOpcode() == WebAssembly::CATCH_I32_S ||
321 MI.getOpcode() == WebAssembly::CATCH_I64_S)
323 if (SeenCatch &&
MI.isCall()) {
336 bool SeenCatchAll =
false;
337 for (
auto &
MI : MBB) {
338 if (
MI.getOpcode() == WebAssembly::CATCH_ALL ||
339 MI.getOpcode() == WebAssembly::CATCH_ALL_S)
341 if (SeenCatchAll &&
MI.isCall()) {
bool isCall(QueryType Type=AnyInBundle) const
This class represents lattice values for constants.
bool mayThrow(const MachineInstr &MI)
unsigned getReg() const
getReg - Returns the register number.
static bool isVirtualRegister(unsigned Reg)
Return true if the specified register number is in the virtual register namespace.
unsigned getNumOperands() const
Retuns the total number of operands.
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
const char *const CxaBeginCatchFn
const char *const StdTerminateFn
bool isVRegStackified(unsigned VReg) const
bool isThrow(const MachineInstr &MI)
bool isCopy(const MachineInstr &MI)
This file contains the declaration of the WebAssembly-specific utility functions. ...
bool isCallDirect(const MachineInstr &MI)
const GlobalValue * getGlobal() const
const char *const CxaRethrowFn
bool isRethrow(const MachineInstr &MI)
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
bool isTee(const MachineInstr &MI)
bool isGlobal() const
isGlobal - Tests if this is a MO_GlobalAddress operand.
const char *const ClangCallTerminateFn
bool isArgument(const MachineInstr &MI)
MachineOperand class - Representation of each machine instruction operand.
bool isCatchTerminatePad(const MachineBasicBlock &MBB)
Returns if the given BB is a single BB terminate pad which starts with a 'catch' instruction.
const char *const PersonalityWrapperFn
Representation of each machine instruction.
This class is derived from MachineFunctionInfo and contains private WebAssembly-specific information ...
bool isEHPad() const
Returns true if the block is a landing pad.
unsigned getCalleeOpNo(const MachineInstr &MI)
Returns the operand number of a callee, assuming the argument is a call instruction.
StringRef getName() const
Return a constant reference to the value's name.
bool isMarker(const MachineInstr &MI)
This file declares WebAssembly-specific per-machine-function information.
LLVM_NODISCARD std::enable_if<!is_simple_type< Y >::value, typename cast_retty< X, const Y >::ret_type >::type dyn_cast(const Y &Val)
bool isCatch(const MachineInstr &MI)
bool isReg() const
isReg - Tests if this is a MO_Register operand.
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
bool isCallIndirect(const MachineInstr &MI)
bool isChild(const MachineInstr &MI, const WebAssemblyFunctionInfo &MFI)
Test whether MI is a child of some other node in an expression tree.
const MachineOperand & getOperand(unsigned i) const
bool isCatchAllTerminatePad(const MachineBasicBlock &MBB)
Returns if the given BB is a single BB terminate pad which starts with a 'catch_all' insrtruction...