#ifdef GET_GLOBALISEL_PREDICATE_BITSET
const unsigned MAX_SUBTARGET_PREDICATES = …;
PredicateBitset;
#endif
#ifdef GET_GLOBALISEL_TEMPORARIES_DECL
mutable MatcherState State;
typedef ComplexRendererFns(BPFInstructionSelector::*ComplexMatcherMemFn)(MachineOperand &) const;
typedef void(BPFInstructionSelector::*CustomRendererFn)(MachineInstrBuilder &, const MachineInstr &, int) const;
const ExecInfoTy<PredicateBitset, ComplexMatcherMemFn, CustomRendererFn> ExecInfo;
static BPFInstructionSelector::ComplexMatcherMemFn ComplexPredicateFns[];
static BPFInstructionSelector::CustomRendererFn CustomRenderers[];
bool testImmPredicate_I64(unsigned PredicateID, int64_t Imm) const override;
bool testImmPredicate_APInt(unsigned PredicateID, const APInt &Imm) const override;
bool testImmPredicate_APFloat(unsigned PredicateID, const APFloat &Imm) const override;
const uint8_t *getMatchTable() const override;
bool testMIPredicate_MI(unsigned PredicateID, const MachineInstr &MI, const MatcherState &State) const override;
bool testSimplePredicate(unsigned PredicateID) const override;
bool runCustomAction(unsigned FnID, const MatcherState &State, NewMIVector &OutMIs) const override;
#endif
#ifdef GET_GLOBALISEL_TEMPORARIES_INIT
, State(0),
ExecInfo(TypeObjects, NumTypeObjects, FeatureBitsets, ComplexPredicateFns, CustomRenderers)
#endif
#ifdef GET_GLOBALISEL_IMPL
enum {
GILLT_s32,
GILLT_s64,
};
const static size_t NumTypeObjects = 2;
const static LLT TypeObjects[] = {
LLT::scalar(32),
LLT::scalar(64),
};
enum SubtargetFeatureBits : uint8_t {
Feature_BPFIsLittleEndianBit = 7,
Feature_BPFIsBigEndianBit = 8,
Feature_BPFHasALU32Bit = 5,
Feature_BPFNoALU32Bit = 2,
Feature_BPFHasLdsxBit = 4,
Feature_BPFHasMovsxBit = 1,
Feature_BPFHasBswapBit = 6,
Feature_BPFHasSdivSmodBit = 0,
Feature_BPFNoMovsxBit = 9,
Feature_BPFHasStoreImmBit = 3,
};
PredicateBitset BPFInstructionSelector::
computeAvailableModuleFeatures(const BPFSubtarget *Subtarget) const {
PredicateBitset Features{};
if (Subtarget->isLittleEndian())
Features.set(Feature_BPFIsLittleEndianBit);
if (!Subtarget->isLittleEndian())
Features.set(Feature_BPFIsBigEndianBit);
if (Subtarget->getHasAlu32())
Features.set(Feature_BPFHasALU32Bit);
if (!Subtarget->getHasAlu32())
Features.set(Feature_BPFNoALU32Bit);
if (Subtarget->hasLdsx())
Features.set(Feature_BPFHasLdsxBit);
if (Subtarget->hasMovsx())
Features.set(Feature_BPFHasMovsxBit);
if (Subtarget->hasBswap())
Features.set(Feature_BPFHasBswapBit);
if (Subtarget->hasSdivSmod())
Features.set(Feature_BPFHasSdivSmodBit);
if (!Subtarget->hasMovsx())
Features.set(Feature_BPFNoMovsxBit);
if (Subtarget->hasStoreImm())
Features.set(Feature_BPFHasStoreImmBit);
return Features;
}
void BPFInstructionSelector::setupGeneratedPerFunctionState(MachineFunction &MF) {
AvailableFunctionFeatures = computeAvailableFunctionFeatures((const BPFSubtarget *)&MF.getSubtarget(), &MF);
}
PredicateBitset BPFInstructionSelector::
computeAvailableFunctionFeatures(const BPFSubtarget *Subtarget, const MachineFunction *MF) const {
PredicateBitset Features{};
return Features;
}
enum {
GIFBS_Invalid,
GIFBS_BPFHasBswap,
GIFBS_BPFHasMovsx,
GIFBS_BPFHasSdivSmod,
GIFBS_BPFIsBigEndian,
GIFBS_BPFIsLittleEndian,
GIFBS_BPFNoMovsx,
};
constexpr static PredicateBitset FeatureBitsets[] {
{},
{Feature_BPFHasBswapBit, },
{Feature_BPFHasMovsxBit, },
{Feature_BPFHasSdivSmodBit, },
{Feature_BPFIsBigEndianBit, },
{Feature_BPFIsLittleEndianBit, },
{Feature_BPFNoMovsxBit, },
};
enum {
GICP_Invalid,
};
BPFInstructionSelector::ComplexMatcherMemFn
BPFInstructionSelector::ComplexPredicateFns[] = {
nullptr,
};
bool BPFInstructionSelector::testMIPredicate_MI(unsigned PredicateID, const MachineInstr & MI, const MatcherState &State) const {
const MachineFunction &MF = *MI.getParent()->getParent();
const MachineRegisterInfo &MRI = MF.getRegInfo();
const auto &Operands = State.RecordedOperands;
(void)Operands;
(void)MRI;
llvm_unreachable("Unknown predicate");
return false;
}
bool BPFInstructionSelector::testImmPredicate_I64(unsigned PredicateID, int64_t Imm) const {
llvm_unreachable("Unknown predicate");
return false;
}
bool BPFInstructionSelector::testImmPredicate_APFloat(unsigned PredicateID, const APFloat & Imm) const {
llvm_unreachable("Unknown predicate");
return false;
}
bool BPFInstructionSelector::testImmPredicate_APInt(unsigned PredicateID, const APInt & Imm) const {
llvm_unreachable("Unknown predicate");
return false;
}
bool BPFInstructionSelector::testSimplePredicate(unsigned) const {
llvm_unreachable("BPFInstructionSelector does not support simple predicates!");
return false;
}
enum {
GICR_Invalid,
};
BPFInstructionSelector::CustomRendererFn
BPFInstructionSelector::CustomRenderers[] = {
nullptr,
};
bool BPFInstructionSelector::selectImpl(MachineInstr &I, CodeGenCoverage &CoverageInfo) const {
const PredicateBitset AvailableFeatures = getAvailableFeatures();
MachineIRBuilder B(I);
State.MIs.clear();
State.MIs.push_back(&I);
if (executeMatchTable(*this, State, ExecInfo, B, getMatchTable(), TII, MF->getRegInfo(), TRI, RBI, AvailableFeatures, &CoverageInfo)) {
return true;
}
return false;
}
bool BPFInstructionSelector::runCustomAction(unsigned, const MatcherState&, NewMIVector &) const {
llvm_unreachable("BPFInstructionSelector does not support custom C++ actions!");
}
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
#define GIMT_Encode2 …
#define GIMT_Encode4 …
#define GIMT_Encode8 …
#else
#define GIMT_Encode2 …
#define GIMT_Encode4 …
#define GIMT_Encode8 …
#endif
const uint8_t *BPFInstructionSelector::getMatchTable() const {
constexpr static uint8_t MatchTable0[] = {
GIM_SwitchOpcode, 0, GIMT_Encode2(53), GIMT_Encode2(243), GIMT_Encode4(2423),
GIMT_Encode4(770),
GIMT_Encode4(836),
GIMT_Encode4(950),
GIMT_Encode4(1016),
GIMT_Encode4(1088),
GIMT_Encode4(1154),
GIMT_Encode4(1226), GIMT_Encode4(0), GIMT_Encode4(0),
GIMT_Encode4(1292),
GIMT_Encode4(1418),
GIMT_Encode4(1484), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
GIMT_Encode4(1550), GIMT_Encode4(0), GIMT_Encode4(0),
GIMT_Encode4(1614),
GIMT_Encode4(1677),
GIMT_Encode4(1719), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
GIMT_Encode4(1742), GIMT_Encode4(0),
GIMT_Encode4(1858),
GIMT_Encode4(1885),
GIMT_Encode4(1951),
GIMT_Encode4(2275), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
GIMT_Encode4(2341), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
GIMT_Encode4(2357),
GIM_SwitchType, 0, 0, GIMT_Encode2(0), GIMT_Encode2(2), GIMT_Encode4(835),
GIMT_Encode4(789),
GIMT_Encode4(812),
GIM_Try, GIMT_Encode4(811),
GIM_RootCheckType, 1, GILLT_s32,
GIM_RootCheckType, 2, GILLT_s32,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPR32RegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::ADD_rr_32),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(834),
GIM_RootCheckType, 1, GILLT_s64,
GIM_RootCheckType, 2, GILLT_s64,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::ADD_rr),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Reject,
GIM_SwitchType, 0, 0, GIMT_Encode2(0), GIMT_Encode2(2), GIMT_Encode4(949),
GIMT_Encode4(855),
GIMT_Encode4(902),
GIM_Try, GIMT_Encode4(901),
GIM_RootCheckType, 1, GILLT_s32,
GIM_RootCheckType, 2, GILLT_s32,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPR32RegClassID),
GIM_Try, GIMT_Encode4(888),
GIM_CheckConstantInt8, 0, 1, 0,
GIR_BuildRootMI, GIMT_Encode2(BPF::NEG_32),
GIR_RootToRootCopy, 0,
GIR_RootToRootCopy, 2,
GIR_RootConstrainSelectedInstOperands,
GIR_EraseRootFromParent_Done,
GIM_Try, GIMT_Encode4(900),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::SUB_rr_32),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Reject,
GIM_Try, GIMT_Encode4(948),
GIM_RootCheckType, 1, GILLT_s64,
GIM_RootCheckType, 2, GILLT_s64,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIM_Try, GIMT_Encode4(935),
GIM_CheckConstantInt8, 0, 1, 0,
GIR_BuildRootMI, GIMT_Encode2(BPF::NEG_64),
GIR_RootToRootCopy, 0,
GIR_RootToRootCopy, 2,
GIR_RootConstrainSelectedInstOperands,
GIR_EraseRootFromParent_Done,
GIM_Try, GIMT_Encode4(947),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::SUB_rr),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Reject,
GIM_Reject,
GIM_SwitchType, 0, 0, GIMT_Encode2(0), GIMT_Encode2(2), GIMT_Encode4(1015),
GIMT_Encode4(969),
GIMT_Encode4(992),
GIM_Try, GIMT_Encode4(991),
GIM_RootCheckType, 1, GILLT_s32,
GIM_RootCheckType, 2, GILLT_s32,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPR32RegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::MUL_rr_32),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1014),
GIM_RootCheckType, 1, GILLT_s64,
GIM_RootCheckType, 2, GILLT_s64,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::MUL_rr),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Reject,
GIM_SwitchType, 0, 0, GIMT_Encode2(0), GIMT_Encode2(2), GIMT_Encode4(1087),
GIMT_Encode4(1035),
GIMT_Encode4(1061),
GIM_Try, GIMT_Encode4(1060),
GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFHasSdivSmod),
GIM_RootCheckType, 1, GILLT_s32,
GIM_RootCheckType, 2, GILLT_s32,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPR32RegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::SDIV_rr_32),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1086),
GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFHasSdivSmod),
GIM_RootCheckType, 1, GILLT_s64,
GIM_RootCheckType, 2, GILLT_s64,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::SDIV_rr),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Reject,
GIM_SwitchType, 0, 0, GIMT_Encode2(0), GIMT_Encode2(2), GIMT_Encode4(1153),
GIMT_Encode4(1107),
GIMT_Encode4(1130),
GIM_Try, GIMT_Encode4(1129),
GIM_RootCheckType, 1, GILLT_s32,
GIM_RootCheckType, 2, GILLT_s32,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPR32RegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::DIV_rr_32),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1152),
GIM_RootCheckType, 1, GILLT_s64,
GIM_RootCheckType, 2, GILLT_s64,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::DIV_rr),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Reject,
GIM_SwitchType, 0, 0, GIMT_Encode2(0), GIMT_Encode2(2), GIMT_Encode4(1225),
GIMT_Encode4(1173),
GIMT_Encode4(1199),
GIM_Try, GIMT_Encode4(1198),
GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFHasSdivSmod),
GIM_RootCheckType, 1, GILLT_s32,
GIM_RootCheckType, 2, GILLT_s32,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPR32RegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::SMOD_rr_32),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1224),
GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFHasSdivSmod),
GIM_RootCheckType, 1, GILLT_s64,
GIM_RootCheckType, 2, GILLT_s64,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::SMOD_rr),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Reject,
GIM_SwitchType, 0, 0, GIMT_Encode2(0), GIMT_Encode2(2), GIMT_Encode4(1291),
GIMT_Encode4(1245),
GIMT_Encode4(1268),
GIM_Try, GIMT_Encode4(1267),
GIM_RootCheckType, 1, GILLT_s32,
GIM_RootCheckType, 2, GILLT_s32,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPR32RegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::MOD_rr_32),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1290),
GIM_RootCheckType, 1, GILLT_s64,
GIM_RootCheckType, 2, GILLT_s64,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::MOD_rr),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Reject,
GIM_SwitchType, 0, 0, GIMT_Encode2(0), GIMT_Encode2(2), GIMT_Encode4(1417),
GIMT_Encode4(1311),
GIMT_Encode4(1334),
GIM_Try, GIMT_Encode4(1333),
GIM_RootCheckType, 1, GILLT_s32,
GIM_RootCheckType, 2, GILLT_s32,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPR32RegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::AND_rr_32),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1416),
GIM_RootCheckType, 1, GILLT_s64,
GIM_RootCheckType, 2, GILLT_s64,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIM_Try, GIMT_Encode4(1403),
GIM_RootCheckRegBankForClass, 1, GIMT_Encode2(BPF::GPRRegClassID),
GIM_CheckConstantInt, 0, 2, GIMT_Encode8(4294967295),
GIR_MakeTempReg, 0, GILLT_s64,
GIR_BuildMI, 1, GIMT_Encode2(BPF::SLL_ri),
GIR_AddTempRegister, 1, 0, GIMT_Encode2(RegState::Define),
GIR_Copy, 1, 0, 1,
GIR_AddImm8, 1, 32,
GIR_ConstrainSelectedInstOperands, 1,
GIR_BuildRootMI, GIMT_Encode2(BPF::SRL_ri),
GIR_RootToRootCopy, 0,
GIR_AddSimpleTempRegister, 0, 0,
GIR_AddImm8, 0, 32,
GIR_RootConstrainSelectedInstOperands,
GIR_EraseRootFromParent_Done,
GIM_Try, GIMT_Encode4(1415),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::AND_rr),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Reject,
GIM_Reject,
GIM_SwitchType, 0, 0, GIMT_Encode2(0), GIMT_Encode2(2), GIMT_Encode4(1483),
GIMT_Encode4(1437),
GIMT_Encode4(1460),
GIM_Try, GIMT_Encode4(1459),
GIM_RootCheckType, 1, GILLT_s32,
GIM_RootCheckType, 2, GILLT_s32,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPR32RegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::OR_rr_32),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1482),
GIM_RootCheckType, 1, GILLT_s64,
GIM_RootCheckType, 2, GILLT_s64,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::OR_rr),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Reject,
GIM_SwitchType, 0, 0, GIMT_Encode2(0), GIMT_Encode2(2), GIMT_Encode4(1549),
GIMT_Encode4(1503),
GIMT_Encode4(1526),
GIM_Try, GIMT_Encode4(1525),
GIM_RootCheckType, 1, GILLT_s32,
GIM_RootCheckType, 2, GILLT_s32,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPR32RegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::XOR_rr_32),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1548),
GIM_RootCheckType, 1, GILLT_s64,
GIM_RootCheckType, 2, GILLT_s64,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::XOR_rr),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Reject,
GIM_Try, GIMT_Encode4(1613),
GIM_CheckNumOperands, 0, 4,
GIM_CheckIntrinsicID, 0, 1, GIMT_Encode2(Intrinsic::bpf_pseudo),
GIM_RootCheckType, 0, GILLT_s64,
GIM_RootCheckType, 2, GILLT_s64,
GIM_RootCheckType, 3, GILLT_s64,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIM_RecordInsn, 1, 0, 2,
GIM_CheckOpcode, 1, GIMT_Encode2(TargetOpcode::G_CONSTANT),
GIM_RecordInsn, 2, 0, 3,
GIM_CheckOpcode, 2, GIMT_Encode2(TargetOpcode::G_CONSTANT),
GIM_CheckIsSafeToFold, 2,
GIR_BuildRootMI, GIMT_Encode2(BPF::LD_pseudo),
GIR_RootToRootCopy, 0,
GIR_CopyConstantAsSImm, 0, 1,
GIR_CopyConstantAsSImm, 0, 2,
GIR_MergeMemOperands, 0, 3, 0, 1, 2,
GIR_RootConstrainSelectedInstOperands,
GIR_EraseRootFromParent_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1676),
GIM_RootCheckType, 0, GILLT_s64,
GIM_RootCheckType, 1, GILLT_s32,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIM_RootCheckRegBankForClass, 1, GIMT_Encode2(BPF::GPR32RegClassID),
GIR_MakeTempReg, 0, GILLT_s64,
GIR_BuildMI, 1, GIMT_Encode2(TargetOpcode::IMPLICIT_DEF),
GIR_AddTempRegister, 1, 0, GIMT_Encode2(RegState::Define),
GIR_ConstrainSelectedInstOperands, 1,
GIR_BuildRootMI, GIMT_Encode2(TargetOpcode::INSERT_SUBREG),
GIR_RootToRootCopy, 0,
GIR_AddSimpleTempRegister, 0, 0,
GIR_RootToRootCopy, 1,
GIR_AddImm8, 0, 1,
GIR_ConstrainOperandRC, 0, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIR_ConstrainOperandRC, 0, 1, GIMT_Encode2(BPF::GPRRegClassID),
GIR_ConstrainOperandRC, 0, 2, GIMT_Encode2(BPF::GPR32RegClassID),
GIR_EraseRootFromParent_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1718),
GIM_RootCheckType, 0, GILLT_s32,
GIM_RootCheckType, 1, GILLT_s64,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIM_RootCheckRegBankForClass, 1, GIMT_Encode2(BPF::GPRRegClassID),
GIR_BuildRootMI, GIMT_Encode2(TargetOpcode::COPY),
GIR_RootToRootCopy, 0,
GIR_CopySubReg, 0, 0, 1, GIMT_Encode2(1),
GIR_ConstrainOperandRC, 0, 0, GIMT_Encode2(BPF::GPR32RegClassID),
GIR_ConstrainOperandRC, 0, 1, GIMT_Encode2(BPF::GPRRegClassID),
GIR_EraseRootFromParent_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1741),
GIM_RootCheckType, 0, GILLT_s64,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIR_BuildRootMI, GIMT_Encode2(BPF::LD_imm64),
GIR_RootToRootCopy, 0,
GIR_CopyConstantAsSImm, 0, 0,
GIR_RootConstrainSelectedInstOperands,
GIR_EraseRootFromParent_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1857),
GIM_RootCheckType, 0, GILLT_s64,
GIM_RootCheckType, 1, GILLT_s32,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIM_RootCheckRegBankForClass, 1, GIMT_Encode2(BPF::GPR32RegClassID),
GIM_Try, GIMT_Encode4(1820),
GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFNoMovsx),
GIR_MakeTempReg, 0, GILLT_s64,
GIR_MakeTempReg, 1, GILLT_s64,
GIR_BuildMI, 2, GIMT_Encode2(BPF::MOV_32_64),
GIR_AddTempRegister, 2, 1, GIMT_Encode2(RegState::Define),
GIR_Copy, 2, 0, 1,
GIR_ConstrainSelectedInstOperands, 2,
GIR_BuildMI, 1, GIMT_Encode2(BPF::SLL_ri),
GIR_AddTempRegister, 1, 0, GIMT_Encode2(RegState::Define),
GIR_AddSimpleTempRegister, 1, 1,
GIR_AddImm8, 1, 32,
GIR_ConstrainSelectedInstOperands, 1,
GIR_BuildRootMI, GIMT_Encode2(BPF::SRA_ri),
GIR_RootToRootCopy, 0,
GIR_AddSimpleTempRegister, 0, 0,
GIR_AddImm8, 0, 32,
GIR_RootConstrainSelectedInstOperands,
GIR_EraseRootFromParent_Done,
GIM_Try, GIMT_Encode4(1856),
GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFHasMovsx),
GIR_MakeTempReg, 0, GILLT_s64,
GIR_BuildMI, 1, GIMT_Encode2(BPF::MOV_32_64),
GIR_AddTempRegister, 1, 0, GIMT_Encode2(RegState::Define),
GIR_Copy, 1, 0, 1,
GIR_ConstrainSelectedInstOperands, 1,
GIR_BuildRootMI, GIMT_Encode2(BPF::MOVSX_rr_32),
GIR_RootToRootCopy, 0,
GIR_AddSimpleTempRegister, 0, 0,
GIR_RootConstrainSelectedInstOperands,
GIR_EraseRootFromParent_Done,
GIM_Reject,
GIM_Reject,
GIM_Try, GIMT_Encode4(1884),
GIM_RootCheckType, 0, GILLT_s64,
GIM_RootCheckType, 1, GILLT_s32,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIM_RootCheckRegBankForClass, 1, GIMT_Encode2(BPF::GPR32RegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::MOV_32_64),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_SwitchType, 0, 0, GIMT_Encode2(0), GIMT_Encode2(2), GIMT_Encode4(1950),
GIMT_Encode4(1904),
GIMT_Encode4(1927),
GIM_Try, GIMT_Encode4(1926),
GIM_RootCheckType, 1, GILLT_s32,
GIM_RootCheckType, 2, GILLT_s32,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPR32RegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::SLL_rr_32),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1949),
GIM_RootCheckType, 1, GILLT_s64,
GIM_RootCheckType, 2, GILLT_s64,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::SLL_rr),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Reject,
GIM_SwitchType, 0, 0, GIMT_Encode2(0), GIMT_Encode2(2), GIMT_Encode4(2274),
GIMT_Encode4(1970),
GIMT_Encode4(1993),
GIM_Try, GIMT_Encode4(1992),
GIM_RootCheckType, 1, GILLT_s32,
GIM_RootCheckType, 2, GILLT_s32,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPR32RegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::SRL_rr_32),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(2273),
GIM_RootCheckType, 1, GILLT_s64,
GIM_RootCheckType, 2, GILLT_s64,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIM_Try, GIMT_Encode4(2050),
GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFHasBswap),
GIM_RecordInsn, 1, 0, 1,
GIM_CheckOpcode, 1, GIMT_Encode2(TargetOpcode::G_BSWAP),
GIM_CheckType, 1, 1, GILLT_s64,
GIM_CheckRegBankForClass, 1, 1, GIMT_Encode2(BPF::GPRRegClassID),
GIM_CheckConstantInt8, 0, 2, 48,
GIM_CheckIsSafeToFold, 1,
GIR_BuildRootMI, GIMT_Encode2(BPF::BSWAP16),
GIR_RootToRootCopy, 0,
GIR_Copy, 0, 1, 1,
GIR_RootConstrainSelectedInstOperands,
GIR_EraseRootFromParent_Done,
GIM_Try, GIMT_Encode4(2092),
GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFHasBswap),
GIM_RecordInsn, 1, 0, 1,
GIM_CheckOpcode, 1, GIMT_Encode2(TargetOpcode::G_BSWAP),
GIM_CheckType, 1, 1, GILLT_s64,
GIM_CheckRegBankForClass, 1, 1, GIMT_Encode2(BPF::GPRRegClassID),
GIM_CheckConstantInt8, 0, 2, 32,
GIM_CheckIsSafeToFold, 1,
GIR_BuildRootMI, GIMT_Encode2(BPF::BSWAP32),
GIR_RootToRootCopy, 0,
GIR_Copy, 0, 1, 1,
GIR_RootConstrainSelectedInstOperands,
GIR_EraseRootFromParent_Done,
GIM_Try, GIMT_Encode4(2134),
GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFIsLittleEndian),
GIM_RecordInsn, 1, 0, 1,
GIM_CheckOpcode, 1, GIMT_Encode2(TargetOpcode::G_BSWAP),
GIM_CheckType, 1, 1, GILLT_s64,
GIM_CheckRegBankForClass, 1, 1, GIMT_Encode2(BPF::GPRRegClassID),
GIM_CheckConstantInt8, 0, 2, 48,
GIM_CheckIsSafeToFold, 1,
GIR_BuildRootMI, GIMT_Encode2(BPF::BE16),
GIR_RootToRootCopy, 0,
GIR_Copy, 0, 1, 1,
GIR_RootConstrainSelectedInstOperands,
GIR_EraseRootFromParent_Done,
GIM_Try, GIMT_Encode4(2176),
GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFIsLittleEndian),
GIM_RecordInsn, 1, 0, 1,
GIM_CheckOpcode, 1, GIMT_Encode2(TargetOpcode::G_BSWAP),
GIM_CheckType, 1, 1, GILLT_s64,
GIM_CheckRegBankForClass, 1, 1, GIMT_Encode2(BPF::GPRRegClassID),
GIM_CheckConstantInt8, 0, 2, 32,
GIM_CheckIsSafeToFold, 1,
GIR_BuildRootMI, GIMT_Encode2(BPF::BE32),
GIR_RootToRootCopy, 0,
GIR_Copy, 0, 1, 1,
GIR_RootConstrainSelectedInstOperands,
GIR_EraseRootFromParent_Done,
GIM_Try, GIMT_Encode4(2218),
GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFIsBigEndian),
GIM_RecordInsn, 1, 0, 1,
GIM_CheckOpcode, 1, GIMT_Encode2(TargetOpcode::G_BSWAP),
GIM_CheckType, 1, 1, GILLT_s64,
GIM_CheckRegBankForClass, 1, 1, GIMT_Encode2(BPF::GPRRegClassID),
GIM_CheckConstantInt8, 0, 2, 48,
GIM_CheckIsSafeToFold, 1,
GIR_BuildRootMI, GIMT_Encode2(BPF::LE16),
GIR_RootToRootCopy, 0,
GIR_Copy, 0, 1, 1,
GIR_RootConstrainSelectedInstOperands,
GIR_EraseRootFromParent_Done,
GIM_Try, GIMT_Encode4(2260),
GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFIsBigEndian),
GIM_RecordInsn, 1, 0, 1,
GIM_CheckOpcode, 1, GIMT_Encode2(TargetOpcode::G_BSWAP),
GIM_CheckType, 1, 1, GILLT_s64,
GIM_CheckRegBankForClass, 1, 1, GIMT_Encode2(BPF::GPRRegClassID),
GIM_CheckConstantInt8, 0, 2, 32,
GIM_CheckIsSafeToFold, 1,
GIR_BuildRootMI, GIMT_Encode2(BPF::LE32),
GIR_RootToRootCopy, 0,
GIR_Copy, 0, 1, 1,
GIR_RootConstrainSelectedInstOperands,
GIR_EraseRootFromParent_Done,
GIM_Try, GIMT_Encode4(2272),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::SRL_rr),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Reject,
GIM_Reject,
GIM_SwitchType, 0, 0, GIMT_Encode2(0), GIMT_Encode2(2), GIMT_Encode4(2340),
GIMT_Encode4(2294),
GIMT_Encode4(2317),
GIM_Try, GIMT_Encode4(2316),
GIM_RootCheckType, 1, GILLT_s32,
GIM_RootCheckType, 2, GILLT_s32,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPR32RegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::SRA_rr_32),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(2339),
GIM_RootCheckType, 1, GILLT_s64,
GIM_RootCheckType, 2, GILLT_s64,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::SRA_rr),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Reject,
GIM_Try, GIMT_Encode4(2356),
GIM_CheckIsMBB, 0, 0,
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::JMP),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(2422),
GIM_RootCheckType, 0, GILLT_s64,
GIM_RootCheckType, 1, GILLT_s64,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIM_RootCheckRegBankForClass, 1, GIMT_Encode2(BPF::GPRRegClassID),
GIM_Try, GIMT_Encode4(2391),
GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFHasBswap),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::BSWAP64),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Try, GIMT_Encode4(2406),
GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFIsLittleEndian),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::BE64),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Try, GIMT_Encode4(2421),
GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFIsBigEndian),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::LE64),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Reject,
GIM_Reject,
};
return MatchTable0;
}
#undef GIMT_Encode2
#undef GIMT_Encode4
#undef GIMT_Encode8
#endif
#ifdef GET_GLOBALISEL_PREDICATES_DECL
PredicateBitset AvailableModuleFeatures;
mutable PredicateBitset AvailableFunctionFeatures;
PredicateBitset getAvailableFeatures() const {
return AvailableModuleFeatures | AvailableFunctionFeatures;
}
PredicateBitset
computeAvailableModuleFeatures(const BPFSubtarget *Subtarget) const;
PredicateBitset
computeAvailableFunctionFeatures(const BPFSubtarget *Subtarget,
const MachineFunction *MF) const;
void setupGeneratedPerFunctionState(MachineFunction &MF) override;
#endif
#ifdef GET_GLOBALISEL_PREDICATES_INIT
AvailableModuleFeatures(computeAvailableModuleFeatures(&STI)),
AvailableFunctionFeatures()
#endif