28 "_Unwind_Wasm_CallPersonality";
33 if (
MI.getNumOperands() == 0)
43 switch (
MI.getOpcode()) {
44 case WebAssembly::THROW:
45 case WebAssembly::THROW_S:
46 case WebAssembly::RETHROW:
47 case WebAssembly::RETHROW_S:
65 if (strcmp(
Name,
"memcpy") == 0 || strcmp(
Name,
"memmove") == 0 ||
66 strcmp(
Name,
"memset") == 0)
71 const auto *
F = dyn_cast<Function>(MO.
getGlobal());
74 if (
F->doesNotThrow())
87 switch (
MI.getOpcode()) {
88 case WebAssembly::CALL:
89 case WebAssembly::CALL_S:
90 case WebAssembly::RET_CALL:
91 case WebAssembly::RET_CALL_S:
92 return MI.getOperand(
MI.getNumExplicitDefs());
93 case WebAssembly::CALL_INDIRECT:
94 case WebAssembly::CALL_INDIRECT_S:
95 case WebAssembly::RET_CALL_INDIRECT:
96 case WebAssembly::RET_CALL_INDIRECT_S:
97 return MI.getOperand(
MI.getNumExplicitOperands() - 1);
108 if (!
Sym->isFunctionTable())
113 Sym->setFunctionTable(is64);
119 Sym->setOmitFromLinkingSection();
128 if (!
Sym->isFunctionTable())
140 Sym->setTableType(TableType);
144 Sym->setOmitFromLinkingSection();
151 auto Pos = EHPad->
begin();
154 while (Pos != EHPad->
end() &&
155 (Pos->isLabel() || Pos->isDebugInstr() ||
isMarker(Pos->getOpcode())))
164 switch (RC->
getID()) {
165 case WebAssembly::I32RegClassID:
166 return WebAssembly::COPY_I32;
167 case WebAssembly::I64RegClassID:
168 return WebAssembly::COPY_I64;
169 case WebAssembly::F32RegClassID:
170 return WebAssembly::COPY_F32;
171 case WebAssembly::F64RegClassID:
172 return WebAssembly::COPY_F64;
173 case WebAssembly::V128RegClassID:
174 return WebAssembly::COPY_V128;
175 case WebAssembly::FUNCREFRegClassID:
176 return WebAssembly::COPY_FUNCREF;
177 case WebAssembly::EXTERNREFRegClassID:
178 return WebAssembly::COPY_EXTERNREF;
179 case WebAssembly::EXNREFRegClassID:
180 return WebAssembly::COPY_EXNREF;
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file declares WebAssembly-specific per-machine-function information.
This file declares the WebAssembly-specific subclass of TargetMachine.
This file contains the declaration of the WebAssembly-specific utility functions.
Context object for machine code objects.
MCSymbol * lookupSymbol(const Twine &Name) const
Get the symbol for Name, or null.
void reportError(SMLoc L, const Twine &Msg)
MCSymbol * getOrCreateSymbol(const Twine &Name)
Lookup the symbol inside with the specified Name.
bool isEHPad() const
Returns true if the block is a landing pad.
Representation of each machine instruction.
MachineOperand class - Representation of each machine instruction operand.
const GlobalValue * getGlobal() const
bool isReg() const
isReg - Tests if this is a MO_Register operand.
bool isSymbol() const
isSymbol - Tests if this is a MO_ExternalSymbol operand.
bool isGlobal() const
isGlobal - Tests if this is a MO_GlobalAddress operand.
const char * getSymbolName() const
Register getReg() const
getReg - Returns the register number.
Wrapper class representing virtual and physical registers.
Represents a location in source code.
StringRef - Represent a constant reference to a string, i.e.
const TargetMachine & getTargetMachine() const
unsigned getID() const
Return the register class ID number.
bool isArch64Bit() const
Test whether the architecture is 64-bit.
This class is derived from MachineFunctionInfo and contains private WebAssembly-specific information ...
bool isVRegStackified(unsigned VReg) const
const Triple & getTargetTriple() const
const WebAssemblyTargetLowering * getTargetLowering() const override
bool hasMultivalue() const
bool hasReferenceTypes() const
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
const char *const StdTerminateFn
const char *const CxaBeginCatchFn
bool isChild(const MachineInstr &MI, const WebAssemblyFunctionInfo &MFI)
Test whether MI is a child of some other node in an expression tree.
bool isCallIndirect(unsigned Opc)
bool canLowerMultivalueReturn(const WebAssemblySubtarget *Subtarget)
Returns true if multivalue returns of a function can be lowered directly, i.e., not indirectly via a ...
const char *const CxaRethrowFn
MCSymbolWasm * getOrCreateFunctionTableSymbol(MCContext &Ctx, const WebAssemblySubtarget *Subtarget)
Returns the __indirect_function_table, for use in call_indirect and in function bitcasts.
bool isMarker(unsigned Opc)
unsigned getCopyOpcodeForRegClass(const TargetRegisterClass *RC)
Returns the appropriate copy opcode for the given register class.
const MachineOperand & getCalleeOp(const MachineInstr &MI)
Returns the operand number of a callee, assuming the argument is a call instruction.
MachineInstr * findCatch(MachineBasicBlock *EHPad)
Find a catch instruction from an EH pad.
bool isCatch(unsigned Opc)
MCSymbolWasm * getOrCreateFuncrefCallTableSymbol(MCContext &Ctx, const WebAssemblySubtarget *Subtarget)
Returns the __funcref_call_table, for use in funcref calls when lowered to table.set + call_indirect.
const char *const PersonalityWrapperFn
bool canLowerReturn(size_t ResultSize, const WebAssemblySubtarget *Subtarget)
Returns true if the function's return value(s) can be lowered directly, i.e., not indirectly via a po...
bool mayThrow(const MachineInstr &MI)
This is an optimization pass for GlobalISel generic memory operations.