25#include "llvm/IR/IntrinsicsWebAssembly.h"
27#define DEBUG_TYPE "wasm-isel"
33#define GET_GLOBALISEL_PREDICATE_BITSET
34#include "WebAssemblyGenGlobalISel.inc"
35#undef GET_GLOBALISEL_PREDICATE_BITSET
56#define GET_GLOBALISEL_PREDICATES_DECL
57#include "WebAssemblyGenGlobalISel.inc"
58#undef GET_GLOBALISEL_PREDICATES_DECL
60#define GET_GLOBALISEL_TEMPORARIES_DECL
61#include "WebAssemblyGenGlobalISel.inc"
62#undef GET_GLOBALISEL_TEMPORARIES_DECL
67#define GET_GLOBALISEL_IMPL
68#include "WebAssemblyGenGlobalISel.inc"
69#undef GET_GLOBALISEL_IMPL
71WebAssemblyInstructionSelector::WebAssemblyInstructionSelector(
74 : TM(TM),
TII(*STI.getInstrInfo()),
75 TRI(*STI.getRegisterInfo()), RBI(RBI),
78#include
"WebAssemblyGenGlobalISel.inc"
81#include
"WebAssemblyGenGlobalISel.inc"
91 if (!
I.isPreISelOpcode())
94 if (selectImpl(
I, *CoverageInfo))
97 using namespace TargetOpcode;
99 switch (
I.getOpcode()) {
100 case G_IMPLICIT_DEF: {
101 const Register DefReg =
I.getOperand(0).getReg();
103 const TargetRegisterClass *DefRC =
104 TRI.getConstrainedRegClassForOperand(
I.getOperand(0), MRI);
109 I.setDesc(
TII.get(TargetOpcode::IMPLICIT_DEF));
124 return new WebAssemblyInstructionSelector(TM, Subtarget, RBI);
#define GET_GLOBALISEL_PREDICATES_INIT
#define GET_GLOBALISEL_TEMPORARIES_INIT
const HexagonInstrInfo * TII
This file declares the MachineIRBuilder class.
Register const TargetRegisterInfo * TRI
Promote Memory to Register
static StringRef getName(Value *V)
This file describes how to lower LLVM code to machine code.
This file provides WebAssembly-specific target descriptions.
This file declares the targeting of the RegisterBankInfo class for WebAssembly.
This file contains the WebAssembly implementation of the WebAssemblyRegisterInfo class.
This file declares the WebAssembly-specific subclass of TargetSubtarget.
This file declares the WebAssembly-specific subclass of TargetMachine.
const MachineFunction * getParent() const
Return the MachineFunction containing this basic block.
MachineRegisterInfo & getRegInfo()
getRegInfo - Return information about the registers currently in use.
Representation of each machine instruction.
static const TargetRegisterClass * constrainGenericRegister(Register Reg, const TargetRegisterClass &RC, MachineRegisterInfo &MRI)
Constrain the (possibly generic) virtual register Reg to RC.
This class provides the information for the target register banks.
This is an optimization pass for GlobalISel generic memory operations.
InstructionSelector * createWebAssemblyInstructionSelector(const WebAssemblyTargetMachine &TM, const WebAssemblySubtarget &Subtarget, const WebAssemblyRegisterBankInfo &RBI)