40 #define DEBUG_TYPE "wasm-call-indirect-fixup"
45 return "WebAssembly CallIndirect Fixup";
58 return new WebAssemblyCallIndirectFixup();
63 using namespace WebAssembly;
64 case PCALL_INDIRECT_VOID:
return CALL_INDIRECT_VOID;
65 case PCALL_INDIRECT_I32:
return CALL_INDIRECT_I32;
66 case PCALL_INDIRECT_I64:
return CALL_INDIRECT_I64;
67 case PCALL_INDIRECT_F32:
return CALL_INDIRECT_F32;
68 case PCALL_INDIRECT_F64:
return CALL_INDIRECT_F64;
69 case PCALL_INDIRECT_v16i8:
return CALL_INDIRECT_v16i8;
70 case PCALL_INDIRECT_v8i16:
return CALL_INDIRECT_v8i16;
71 case PCALL_INDIRECT_v4i32:
return CALL_INDIRECT_v4i32;
72 case PCALL_INDIRECT_v4f32:
return CALL_INDIRECT_v4f32;
73 default:
return INSTRUCTION_LIST_END;
79 WebAssembly::INSTRUCTION_LIST_END;
82 bool WebAssemblyCallIndirectFixup::runOnMachineFunction(
MachineFunction &MF) {
83 DEBUG(
dbgs() <<
"********** Fixing up CALL_INDIRECTs **********\n"
93 DEBUG(
dbgs() <<
"Found call_indirect: " <<
MI <<
'\n');
100 auto Uses =
MI.explicit_uses();
108 MI.addOperand(MF, MO);
116 DEBUG(
dbgs() <<
"\nDone fixing up CALL_INDIRECTs\n\n");
static unsigned GetNonPseudoCallIndirectOpcode(const MachineInstr &MI)
FunctionPass * createWebAssemblyCallIndirectFixup()
Describe properties that are true of each instruction in the target description file.
MachineInstrBuilder MachineInstrBuilder &DefMI const MCInstrDesc & Desc
This file contains the entry points for global functions defined in the LLVM WebAssembly back-end...
const TargetSubtargetInfo & getSubtarget() const
getSubtarget - Return the subtarget for which this machine code is being compiled.
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
const HexagonInstrInfo * TII
static bool IsPseudoCallIndirect(const MachineInstr &MI)
unsigned getOpcode() const
Returns the opcode of this MachineInstr.
void ChangeToImmediate(int64_t ImmVal)
ChangeToImmediate - Replace this operand with a new immediate operand of the specified value...
This file provides WebAssembly-specific target descriptions.
FunctionPass class - This class is used to implement most global optimizations.
This file declares the WebAssembly-specific subclass of TargetSubtarget.
MachineOperand class - Representation of each machine instruction operand.
raw_ostream & dbgs()
dbgs() - This returns a reference to a raw_ostream for debugging messages.
Representation of each machine instruction.
This file declares WebAssembly-specific per-machine-function information.
StringRef - Represent a constant reference to a string, i.e.
StringRef getName() const
getName - Return the name of the corresponding LLVM function.