#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(52), GIMT_Encode2(238), GIMT_Encode4(2407),
GIMT_Encode4(754),
GIMT_Encode4(820),
GIMT_Encode4(934),
GIMT_Encode4(1000),
GIMT_Encode4(1072),
GIMT_Encode4(1138),
GIMT_Encode4(1210), GIMT_Encode4(0), GIMT_Encode4(0),
GIMT_Encode4(1276),
GIMT_Encode4(1402),
GIMT_Encode4(1468), 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(1534), GIMT_Encode4(0), GIMT_Encode4(0),
GIMT_Encode4(1598),
GIMT_Encode4(1661),
GIMT_Encode4(1703), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
GIMT_Encode4(1726), GIMT_Encode4(0),
GIMT_Encode4(1842),
GIMT_Encode4(1869),
GIMT_Encode4(1935),
GIMT_Encode4(2259), 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(2325), 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),
GIM_SwitchType, 0, 0, GIMT_Encode2(0), GIMT_Encode2(2), GIMT_Encode4(819),
GIMT_Encode4(773),
GIMT_Encode4(796),
GIM_Try, GIMT_Encode4(795),
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(818),
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(933),
GIMT_Encode4(839),
GIMT_Encode4(886),
GIM_Try, GIMT_Encode4(885),
GIM_RootCheckType, 1, GILLT_s32,
GIM_RootCheckType, 2, GILLT_s32,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPR32RegClassID),
GIM_Try, GIMT_Encode4(872),
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(884),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::SUB_rr_32),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Reject,
GIM_Try, GIMT_Encode4(932),
GIM_RootCheckType, 1, GILLT_s64,
GIM_RootCheckType, 2, GILLT_s64,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIM_Try, GIMT_Encode4(919),
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(931),
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(999),
GIMT_Encode4(953),
GIMT_Encode4(976),
GIM_Try, GIMT_Encode4(975),
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(998),
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(1071),
GIMT_Encode4(1019),
GIMT_Encode4(1045),
GIM_Try, GIMT_Encode4(1044),
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(1070),
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(1137),
GIMT_Encode4(1091),
GIMT_Encode4(1114),
GIM_Try, GIMT_Encode4(1113),
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(1136),
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(1209),
GIMT_Encode4(1157),
GIMT_Encode4(1183),
GIM_Try, GIMT_Encode4(1182),
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(1208),
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(1275),
GIMT_Encode4(1229),
GIMT_Encode4(1252),
GIM_Try, GIMT_Encode4(1251),
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(1274),
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(1401),
GIMT_Encode4(1295),
GIMT_Encode4(1318),
GIM_Try, GIMT_Encode4(1317),
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(1400),
GIM_RootCheckType, 1, GILLT_s64,
GIM_RootCheckType, 2, GILLT_s64,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIM_Try, GIMT_Encode4(1387),
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(1399),
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(1467),
GIMT_Encode4(1421),
GIMT_Encode4(1444),
GIM_Try, GIMT_Encode4(1443),
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(1466),
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(1533),
GIMT_Encode4(1487),
GIMT_Encode4(1510),
GIM_Try, GIMT_Encode4(1509),
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(1532),
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(1597),
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(1660),
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(1702),
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(1725),
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(1841),
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(1804),
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(1840),
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(1868),
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(1934),
GIMT_Encode4(1888),
GIMT_Encode4(1911),
GIM_Try, GIMT_Encode4(1910),
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(1933),
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(2258),
GIMT_Encode4(1954),
GIMT_Encode4(1977),
GIM_Try, GIMT_Encode4(1976),
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(2257),
GIM_RootCheckType, 1, GILLT_s64,
GIM_RootCheckType, 2, GILLT_s64,
GIM_RootCheckRegBankForClass, 0, GIMT_Encode2(BPF::GPRRegClassID),
GIM_Try, GIMT_Encode4(2034),
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(2076),
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(2118),
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(2160),
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(2202),
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(2244),
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(2256),
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(2324),
GIMT_Encode4(2278),
GIMT_Encode4(2301),
GIM_Try, GIMT_Encode4(2300),
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(2323),
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(2340),
GIM_CheckIsMBB, 0, 0,
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::JMP),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(2406),
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(2375),
GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFHasBswap),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::BSWAP64),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Try, GIMT_Encode4(2390),
GIM_CheckFeatures, GIMT_Encode2(GIFBS_BPFIsLittleEndian),
GIR_MutateOpcode, 0, 0, GIMT_Encode2(BPF::BE64),
GIR_RootConstrainSelectedInstOperands,
GIR_Done,
GIM_Try, GIMT_Encode4(2405),
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