#ifdef GET_GICOMBINER_DEPS
#include "llvm/ADT/SparseBitVector.h"
namespace llvm {
extern cl::OptionCategory GICombinerOptionCategory;
}
#endif
#ifdef GET_GICOMBINER_TYPES
struct RISCVPostLegalizerCombinerImplRuleConfig {
SparseBitVector<> DisabledRules;
bool isRuleEnabled(unsigned RuleID) const;
bool parseCommandLineOption();
bool setRuleEnabled(StringRef RuleIdentifier);
bool setRuleDisabled(StringRef RuleIdentifier);
};
static std::optional<uint64_t> getRuleIdxForIdentifier(StringRef RuleIdentifier) {
uint64_t I;
bool Parsed = !RuleIdentifier.getAsInteger(0, I);
if (Parsed)
return I;
#ifndef NDEBUG
switch (RuleIdentifier.size()) {
default: break;
case 10:
switch (RuleIdentifier[0]) {
default: break;
case 'i':
if (memcmp(RuleIdentifier.data()+1, "2p_to_p2i", 9) != 0)
break;
return 7;
case 'p':
if (memcmp(RuleIdentifier.data()+1, "2i_to_i2p", 9) != 0)
break;
return 6;
}
break;
case 11:
if (memcmp(RuleIdentifier.data()+0, "add_sub_reg", 11) != 0)
break;
return 12;
case 13:
if (memcmp(RuleIdentifier.data()+0, "redundant_and", 13) != 0)
break;
return 0;
case 14:
switch (RuleIdentifier[0]) {
default: break;
case 'b':
if (memcmp(RuleIdentifier.data()+1, "inop_same_val", 13) != 0)
break;
return 3;
case 'f':
if (memcmp(RuleIdentifier.data()+1, "neg_fneg_fold", 13) != 0)
break;
return 9;
}
break;
case 15:
if (memcmp(RuleIdentifier.data()+0, "select_same_val", 15) != 0)
break;
return 1;
case 17:
if (memcmp(RuleIdentifier.data()+0, "anyext_trunc_fold", 17) != 0)
break;
return 8;
case 18:
switch (RuleIdentifier[0]) {
default: break;
case 'b':
if (memcmp(RuleIdentifier.data()+1, "inop_left_to_zero", 17) != 0)
break;
return 4;
case 'f':
if (memcmp(RuleIdentifier.data()+1, "ptrunc_fpext_fold", 17) != 0)
break;
return 17;
}
break;
case 19:
switch (RuleIdentifier[0]) {
default: break;
case 'b':
if (memcmp(RuleIdentifier.data()+1, "inop_right_to_zero", 18) != 0)
break;
return 5;
case 'r':
if (memcmp(RuleIdentifier.data()+1, "ight_identity_zero", 18) != 0)
break;
return 2;
}
break;
case 20:
if (memcmp(RuleIdentifier.data()+0, "bitcast_bitcast_fold", 20) != 0)
break;
return 16;
case 21:
if (memcmp(RuleIdentifier.data()+0, "right_identity_one_fp", 21) != 0)
break;
return 11;
case 22:
switch (RuleIdentifier[0]) {
default: break;
case 'r':
if (memcmp(RuleIdentifier.data()+1, "ight_identity_one_int", 21) != 0)
break;
return 10;
case 't':
if (memcmp(RuleIdentifier.data()+1, "runc_buildvector_fold", 21) != 0)
break;
return 14;
}
break;
case 25:
switch (RuleIdentifier[0]) {
default: break;
case 'b':
if (memcmp(RuleIdentifier.data()+1, "uildvector_identity_fold", 24) != 0)
break;
return 13;
case 'r':
if (memcmp(RuleIdentifier.data()+1, "ight_identity_neg_one_fp", 24) != 0)
break;
return 19;
}
break;
case 26:
if (memcmp(RuleIdentifier.data()+0, "right_identity_neg_zero_fp", 26) != 0)
break;
return 18;
case 27:
if (memcmp(RuleIdentifier.data()+0, "trunc_lshr_buildvector_fold", 27) != 0)
break;
return 15;
}
#endif
return std::nullopt;
}
static std::optional<std::pair<uint64_t, uint64_t>> getRuleRangeForIdentifier(StringRef RuleIdentifier) {
std::pair<StringRef, StringRef> RangePair = RuleIdentifier.split('-');
if (!RangePair.second.empty()) {
const auto First = getRuleIdxForIdentifier(RangePair.first);
const auto Last = getRuleIdxForIdentifier(RangePair.second);
if (!First || !Last)
return std::nullopt;
if (First >= Last)
report_fatal_error("Beginning of range should be before end of range");
return {{*First, *Last + 1}};
}
if (RangePair.first == "*") {
return {{0, 20}};
}
const auto I = getRuleIdxForIdentifier(RangePair.first);
if (!I)
return std::nullopt;
return {{*I, *I + 1}};
}
bool RISCVPostLegalizerCombinerImplRuleConfig::setRuleEnabled(StringRef RuleIdentifier) {
auto MaybeRange = getRuleRangeForIdentifier(RuleIdentifier);
if (!MaybeRange)
return false;
for (auto I = MaybeRange->first; I < MaybeRange->second; ++I)
DisabledRules.reset(I);
return true;
}
bool RISCVPostLegalizerCombinerImplRuleConfig::setRuleDisabled(StringRef RuleIdentifier) {
auto MaybeRange = getRuleRangeForIdentifier(RuleIdentifier);
if (!MaybeRange)
return false;
for (auto I = MaybeRange->first; I < MaybeRange->second; ++I)
DisabledRules.set(I);
return true;
}
static std::vector<std::string> RISCVPostLegalizerCombinerOption;
static cl::list<std::string> RISCVPostLegalizerCombinerDisableOption(
"riscvpostlegalizercombiner-disable-rule",
cl::desc("Disable one or more combiner rules temporarily in the RISCVPostLegalizerCombiner pass"),
cl::CommaSeparated,
cl::Hidden,
cl::cat(GICombinerOptionCategory),
cl::callback([](const std::string &Str) {
RISCVPostLegalizerCombinerOption.push_back(Str);
}));
static cl::list<std::string> RISCVPostLegalizerCombinerOnlyEnableOption(
"riscvpostlegalizercombiner-only-enable-rule",
cl::desc("Disable all rules in the RISCVPostLegalizerCombiner pass then re-enable the specified ones"),
cl::Hidden,
cl::cat(GICombinerOptionCategory),
cl::callback([](const std::string &CommaSeparatedArg) {
StringRef Str = CommaSeparatedArg;
RISCVPostLegalizerCombinerOption.push_back("*");
do {
auto X = Str.split(",");
RISCVPostLegalizerCombinerOption.push_back(("!" + X.first).str());
Str = X.second;
} while (!Str.empty());
}));
bool RISCVPostLegalizerCombinerImplRuleConfig::isRuleEnabled(unsigned RuleID) const {
return !DisabledRules.test(RuleID);
}
bool RISCVPostLegalizerCombinerImplRuleConfig::parseCommandLineOption() {
for (StringRef Identifier : RISCVPostLegalizerCombinerOption) {
bool Enabled = Identifier.consume_front("!");
if (Enabled && !setRuleEnabled(Identifier))
return false;
if (!Enabled && !setRuleDisabled(Identifier))
return false;
}
return true;
}
#endif
#ifdef GET_GICOMBINER_TYPES
const unsigned MAX_SUBTARGET_PREDICATES = 0;
using PredicateBitset = llvm::Bitset<MAX_SUBTARGET_PREDICATES>;
#endif
#ifdef GET_GICOMBINER_CLASS_MEMBERS
PredicateBitset AvailableModuleFeatures;
mutable PredicateBitset AvailableFunctionFeatures;
PredicateBitset getAvailableFeatures() const {
return AvailableModuleFeatures | AvailableFunctionFeatures;
}
PredicateBitset
computeAvailableModuleFeatures(const RISCVSubtarget *Subtarget) const;
PredicateBitset
computeAvailableFunctionFeatures(const RISCVSubtarget *Subtarget,
const MachineFunction *MF) const;
void setupGeneratedPerFunctionState(MachineFunction &MF) override;
#endif
#ifdef GET_GICOMBINER_CLASS_MEMBERS
mutable MatcherState State;
typedef ComplexRendererFns(RISCVPostLegalizerCombinerImpl::*ComplexMatcherMemFn)(MachineOperand &) const;
typedef void(RISCVPostLegalizerCombinerImpl::*CustomRendererFn)(MachineInstrBuilder &, const MachineInstr &, int) const;
const ExecInfoTy<PredicateBitset, ComplexMatcherMemFn, CustomRendererFn> ExecInfo;
static RISCVPostLegalizerCombinerImpl::ComplexMatcherMemFn ComplexPredicateFns[];
static RISCVPostLegalizerCombinerImpl::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_GICOMBINER_IMPL
enum {
GILLT_s1,
};
const static size_t NumTypeObjects = 1;
const static LLT TypeObjects[] = {
LLT::scalar(1),
};
enum SubtargetFeatureBits : uint8_t {
};
PredicateBitset RISCVPostLegalizerCombinerImpl::
computeAvailableModuleFeatures(const RISCVSubtarget *Subtarget) const {
PredicateBitset Features{};
return Features;
}
void RISCVPostLegalizerCombinerImpl::setupGeneratedPerFunctionState(MachineFunction &MF) {
AvailableFunctionFeatures = computeAvailableFunctionFeatures((const RISCVSubtarget *)&MF.getSubtarget(), &MF);
}
PredicateBitset RISCVPostLegalizerCombinerImpl::
computeAvailableFunctionFeatures(const RISCVSubtarget *Subtarget, const MachineFunction *MF) const {
PredicateBitset Features{};
return Features;
}
enum {
GIFBS_Invalid,
};
constexpr static PredicateBitset FeatureBitsets[] {
{},
};
enum {
GICP_Invalid,
};
RISCVPostLegalizerCombinerImpl::ComplexMatcherMemFn
RISCVPostLegalizerCombinerImpl::ComplexPredicateFns[] = {
nullptr,
};
enum {
GICXXPred_MI_Predicate_GICombiner0 = GICXXPred_Invalid + 1,
GICXXPred_MI_Predicate_GICombiner1,
GICXXPred_MI_Predicate_GICombiner2,
};
bool RISCVPostLegalizerCombinerImpl::testMIPredicate_MI(unsigned PredicateID, const MachineInstr & MI, const MatcherState &State) const {
switch (PredicateID) {
case GICXXPred_MI_Predicate_GICombiner0: {
return Helper.matchConstantFPOp(State.MIs[0]->getOperand(2), 1.0);
}
case GICXXPred_MI_Predicate_GICombiner1: {
return Helper.matchConstantFPOp(State.MIs[0]->getOperand(2), -0.0);
}
case GICXXPred_MI_Predicate_GICombiner2: {
return Helper.matchConstantFPOp(State.MIs[0]->getOperand(2), -1.0);
}
}
llvm_unreachable("Unknown predicate");
return false;
}
bool RISCVPostLegalizerCombinerImpl::testImmPredicate_I64(unsigned PredicateID, int64_t Imm) const {
llvm_unreachable("Unknown predicate");
return false;
}
bool RISCVPostLegalizerCombinerImpl::testImmPredicate_APFloat(unsigned PredicateID, const APFloat & Imm) const {
llvm_unreachable("Unknown predicate");
return false;
}
bool RISCVPostLegalizerCombinerImpl::testImmPredicate_APInt(unsigned PredicateID, const APInt & Imm) const {
llvm_unreachable("Unknown predicate");
return false;
}
enum {
GICXXPred_Simple_IsRule0Enabled = GICXXPred_Invalid + 1,
GICXXPred_Simple_IsRule1Enabled,
GICXXPred_Simple_IsRule2Enabled,
GICXXPred_Simple_IsRule3Enabled,
GICXXPred_Simple_IsRule4Enabled,
GICXXPred_Simple_IsRule5Enabled,
GICXXPred_Simple_IsRule6Enabled,
GICXXPred_Simple_IsRule7Enabled,
GICXXPred_Simple_IsRule8Enabled,
GICXXPred_Simple_IsRule9Enabled,
GICXXPred_Simple_IsRule10Enabled,
GICXXPred_Simple_IsRule11Enabled,
GICXXPred_Simple_IsRule12Enabled,
GICXXPred_Simple_IsRule13Enabled,
GICXXPred_Simple_IsRule14Enabled,
GICXXPred_Simple_IsRule15Enabled,
GICXXPred_Simple_IsRule16Enabled,
GICXXPred_Simple_IsRule17Enabled,
GICXXPred_Simple_IsRule18Enabled,
GICXXPred_Simple_IsRule19Enabled,
};
bool RISCVPostLegalizerCombinerImpl::testSimplePredicate(unsigned Predicate) const {
return RuleConfig.isRuleEnabled(Predicate - GICXXPred_Invalid - 1);
}
enum {
GICR_Invalid,
};
RISCVPostLegalizerCombinerImpl::CustomRendererFn
RISCVPostLegalizerCombinerImpl::CustomRenderers[] = {
nullptr,
};
bool RISCVPostLegalizerCombinerImpl::tryCombineAll(MachineInstr &I) const {
const TargetSubtargetInfo &ST = MF.getSubtarget();
const PredicateBitset AvailableFeatures = getAvailableFeatures();
B.setInstrAndDebugLoc(I);
State.MIs.clear();
State.MIs.push_back(&I);
if (executeMatchTable(*this, State, ExecInfo, B, getMatchTable(), *ST.getInstrInfo(), MRI, *MRI.getTargetRegisterInfo(), *ST.getRegBankInfo(), AvailableFeatures, nullptr)) {
return true;
}
return false;
}
enum {
GICXXCustomAction_GICombiner0 = GICXXCustomAction_Invalid + 1,
GICXXCustomAction_GICombiner1,
GICXXCustomAction_GICombiner2,
GICXXCustomAction_GICombiner3,
GICXXCustomAction_GICombiner4,
GICXXCustomAction_GICombiner5,
GICXXCustomAction_GICombiner6,
GICXXCustomAction_GICombiner7,
GICXXCustomAction_GICombiner8,
GICXXCustomAction_GICombiner9,
};
bool RISCVPostLegalizerCombinerImpl::runCustomAction(unsigned ApplyID, const MatcherState &State, NewMIVector &OutMIs) const {
Helper.getBuilder().setInstrAndDebugLoc(*State.MIs[0]);
switch(ApplyID) {
case GICXXCustomAction_GICombiner0:{
Register GIMatchData_matchinfo;
if(![&](){return Helper.matchRedundantAnd(*State.MIs[0], GIMatchData_matchinfo);}()) {
return false;
}
Helper.replaceSingleDefInstWithReg(*State.MIs[0], GIMatchData_matchinfo);
return true;
}
case GICXXCustomAction_GICombiner1:{
if(![&](){return Helper.matchSelectSameVal(*State.MIs[0]);}()) {
return false;
}
Helper.replaceSingleDefInstWithOperand(*State.MIs[0], 2);
return true;
}
case GICXXCustomAction_GICombiner2:{
if(![&](){return Helper.matchOperandIsZero(*State.MIs[0], 1);}()) {
return false;
}
Helper.replaceSingleDefInstWithOperand(*State.MIs[0], 1);
return true;
}
case GICXXCustomAction_GICombiner3:{
Register GIMatchData_info;
if(![&](){return Helper.matchCombineI2PToP2I(*State.MIs[0], GIMatchData_info);}()) {
return false;
}
Helper.applyCombineI2PToP2I(*State.MIs[0], GIMatchData_info);
return true;
}
case GICXXCustomAction_GICombiner4:{
Register GIMatchData_info;
if(![&](){GIMatchData_info = State.MIs[1]->getOperand(1).getReg(); return true;}()) {
return false;
}
Helper.applyCombineP2IToI2P(*State.MIs[0], GIMatchData_info);
return true;
}
case GICXXCustomAction_GICombiner5:{
Register GIMatchData_matchinfo;
if(![&](){return Helper.matchCombineAnyExtTrunc(*State.MIs[0], GIMatchData_matchinfo);}()) {
return false;
}
Helper.replaceSingleDefInstWithReg(*State.MIs[0], GIMatchData_matchinfo);
return true;
}
case GICXXCustomAction_GICombiner6:{
Register GIMatchData_matchinfo;
if(![&](){return Helper.matchBuildVectorIdentityFold(*State.MIs[0], GIMatchData_matchinfo);}()) {
return false;
}
Helper.replaceSingleDefInstWithReg(*State.MIs[0], GIMatchData_matchinfo);
return true;
}
case GICXXCustomAction_GICombiner7:{
Register GIMatchData_matchinfo;
if(![&](){return Helper.matchTruncBuildVectorFold(*State.MIs[0], GIMatchData_matchinfo);}()) {
return false;
}
Helper.replaceSingleDefInstWithReg(*State.MIs[0], GIMatchData_matchinfo);
return true;
}
case GICXXCustomAction_GICombiner8:{
Register GIMatchData_matchinfo;
if(![&](){return Helper.matchTruncLshrBuildVectorFold(*State.MIs[0], GIMatchData_matchinfo);}()) {
return false;
}
Helper.replaceSingleDefInstWithReg(*State.MIs[0], GIMatchData_matchinfo);
return true;
}
case GICXXCustomAction_GICombiner9:{
if(![&](){return MRI.getType(State.MIs[1]->getOperand(1).getReg()) == MRI.getType(State.MIs[0]->getOperand(0).getReg());}()) {
return false;
}
Helper.replaceSingleDefInstWithReg(*State.MIs[0], State.MIs[1]->getOperand(1).getReg());
return true;
}
}
llvm_unreachable("Unknown Apply Action");
}
#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 *RISCVPostLegalizerCombinerImpl::getMatchTable() const {
constexpr static uint8_t MatchTable0[] = {
GIM_SwitchOpcode, 0, GIMT_Encode2(52), GIMT_Encode2(214), GIMT_Encode4(1368),
GIMT_Encode4(658),
GIMT_Encode4(750),
GIMT_Encode4(774),
GIMT_Encode4(821),
GIMT_Encode4(833),
GIMT_Encode4(845),
GIMT_Encode4(857), GIMT_Encode4(0), GIMT_Encode4(0),
GIMT_Encode4(869),
GIMT_Encode4(905),
GIMT_Encode4(953), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
GIMT_Encode4(977),
GIMT_Encode4(989), GIMT_Encode4(0),
GIMT_Encode4(1001),
GIMT_Encode4(1023),
GIMT_Encode4(1035), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
GIMT_Encode4(1057),
GIMT_Encode4(1069), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
GIMT_Encode4(1092),
GIMT_Encode4(1116),
GIMT_Encode4(1140), GIMT_Encode4(0), GIMT_Encode4(0),
GIMT_Encode4(1164),
GIMT_Encode4(1188), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
GIMT_Encode4(1212), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
GIMT_Encode4(1224), GIMT_Encode4(0),
GIMT_Encode4(1248), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
GIMT_Encode4(1292), GIMT_Encode4(0),
GIMT_Encode4(1322), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
GIMT_Encode4(1344),
GIM_Try, GIMT_Encode4(692),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule12Enabled),
GIM_RecordInsnIgnoreCopies, 1, 0, 1,
GIM_CheckOpcode, 1, GIMT_Encode2(TargetOpcode::G_SUB),
GIM_CheckIsSameOperandIgnoreCopies, 0, 2, 1, 2,
GIM_CheckCanReplaceReg, 0, 0, 1, 1,
GIM_CheckIsSafeToFold, 1,
GIR_ReplaceReg, 0, 0, 1, 1,
GIR_EraseRootFromParent_Done,
GIM_Try, GIMT_Encode4(726),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule12Enabled),
GIM_RecordInsnIgnoreCopies, 1, 0, 2,
GIM_CheckOpcode, 1, GIMT_Encode2(TargetOpcode::G_SUB),
GIM_CheckIsSameOperandIgnoreCopies, 1, 2, 0, 1,
GIM_CheckCanReplaceReg, 0, 0, 1, 1,
GIM_CheckIsSafeToFold, 1,
GIR_ReplaceReg, 0, 0, 1, 1,
GIR_EraseRootFromParent_Done,
GIM_Try, GIMT_Encode4(749),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule2Enabled),
GIM_CheckConstantInt8, 0, 2, 0,
GIM_CheckCanReplaceReg, 0, 0, 0, 1,
GIR_ReplaceReg, 0, 0, 0, 1,
GIR_EraseRootFromParent_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(773),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule2Enabled),
GIM_CheckConstantInt8, 0, 2, 0,
GIM_CheckCanReplaceReg, 0, 0, 0, 1,
GIR_ReplaceReg, 0, 0, 0, 1,
GIR_EraseRootFromParent_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(797),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule5Enabled),
GIM_CheckConstantInt8, 0, 2, 0,
GIM_CheckCanReplaceReg, 0, 0, 0, 2,
GIR_ReplaceReg, 0, 0, 0, 2,
GIR_EraseRootFromParent_Done,
GIM_Try, GIMT_Encode4(820),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule10Enabled),
GIM_CheckConstantInt8, 0, 2, 1,
GIM_CheckCanReplaceReg, 0, 0, 0, 1,
GIR_ReplaceReg, 0, 0, 0, 1,
GIR_EraseRootFromParent_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(832),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule4Enabled),
GIR_DoneWithCustomAction, GIMT_Encode2(GICXXCustomAction_GICombiner2),
GIM_Reject,
GIM_Try, GIMT_Encode4(844),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule4Enabled),
GIR_DoneWithCustomAction, GIMT_Encode2(GICXXCustomAction_GICombiner2),
GIM_Reject,
GIM_Try, GIMT_Encode4(856),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule4Enabled),
GIR_DoneWithCustomAction, GIMT_Encode2(GICXXCustomAction_GICombiner2),
GIM_Reject,
GIM_Try, GIMT_Encode4(868),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule4Enabled),
GIR_DoneWithCustomAction, GIMT_Encode2(GICXXCustomAction_GICombiner2),
GIM_Reject,
GIM_Try, GIMT_Encode4(880),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule0Enabled),
GIR_DoneWithCustomAction, GIMT_Encode2(GICXXCustomAction_GICombiner0),
GIM_Try, GIMT_Encode4(904),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule3Enabled),
GIM_CheckIsSameOperandIgnoreCopies, 0, 2, 0, 1,
GIM_CheckCanReplaceReg, 0, 0, 0, 1,
GIR_ReplaceReg, 0, 0, 0, 1,
GIR_EraseRootFromParent_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(929),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule3Enabled),
GIM_CheckIsSameOperandIgnoreCopies, 0, 2, 0, 1,
GIM_CheckCanReplaceReg, 0, 0, 0, 1,
GIR_ReplaceReg, 0, 0, 0, 1,
GIR_EraseRootFromParent_Done,
GIM_Try, GIMT_Encode4(952),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule2Enabled),
GIM_CheckConstantInt8, 0, 2, 0,
GIM_CheckCanReplaceReg, 0, 0, 0, 1,
GIR_ReplaceReg, 0, 0, 0, 1,
GIR_EraseRootFromParent_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(976),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule2Enabled),
GIM_CheckConstantInt8, 0, 2, 0,
GIM_CheckCanReplaceReg, 0, 0, 0, 1,
GIR_ReplaceReg, 0, 0, 0, 1,
GIR_EraseRootFromParent_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(988),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule13Enabled),
GIR_DoneWithCustomAction, GIMT_Encode2(GICXXCustomAction_GICombiner6),
GIM_Reject,
GIM_Try, GIMT_Encode4(1000),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule13Enabled),
GIR_DoneWithCustomAction, GIMT_Encode2(GICXXCustomAction_GICombiner6),
GIM_Reject,
GIM_Try, GIMT_Encode4(1022),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule7Enabled),
GIM_RecordInsnIgnoreCopies, 1, 0, 1,
GIM_CheckOpcode, 1, GIMT_Encode2(TargetOpcode::G_INTTOPTR),
GIM_CheckIsSafeToFold, 1,
GIR_DoneWithCustomAction, GIMT_Encode2(GICXXCustomAction_GICombiner4),
GIM_Reject,
GIM_Try, GIMT_Encode4(1034),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule6Enabled),
GIR_DoneWithCustomAction, GIMT_Encode2(GICXXCustomAction_GICombiner3),
GIM_Reject,
GIM_Try, GIMT_Encode4(1056),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule16Enabled),
GIM_RecordInsnIgnoreCopies, 1, 0, 1,
GIM_CheckOpcode, 1, GIMT_Encode2(TargetOpcode::G_BITCAST),
GIM_CheckIsSafeToFold, 1,
GIR_DoneWithCustomAction, GIMT_Encode2(GICXXCustomAction_GICombiner9),
GIM_Reject,
GIM_Try, GIMT_Encode4(1068),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule8Enabled),
GIR_DoneWithCustomAction, GIMT_Encode2(GICXXCustomAction_GICombiner5),
GIM_Reject,
GIM_Try, GIMT_Encode4(1080),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule14Enabled),
GIR_DoneWithCustomAction, GIMT_Encode2(GICXXCustomAction_GICombiner7),
GIM_Try, GIMT_Encode4(1091),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule15Enabled),
GIR_DoneWithCustomAction, GIMT_Encode2(GICXXCustomAction_GICombiner8),
GIM_Reject,
GIM_Try, GIMT_Encode4(1115),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule2Enabled),
GIM_CheckConstantInt8, 0, 2, 0,
GIM_CheckCanReplaceReg, 0, 0, 0, 1,
GIR_ReplaceReg, 0, 0, 0, 1,
GIR_EraseRootFromParent_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1139),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule2Enabled),
GIM_CheckConstantInt8, 0, 2, 0,
GIM_CheckCanReplaceReg, 0, 0, 0, 1,
GIR_ReplaceReg, 0, 0, 0, 1,
GIR_EraseRootFromParent_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1163),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule2Enabled),
GIM_CheckConstantInt8, 0, 2, 0,
GIM_CheckCanReplaceReg, 0, 0, 0, 1,
GIR_ReplaceReg, 0, 0, 0, 1,
GIR_EraseRootFromParent_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1187),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule2Enabled),
GIM_CheckConstantInt8, 0, 2, 0,
GIM_CheckCanReplaceReg, 0, 0, 0, 1,
GIR_ReplaceReg, 0, 0, 0, 1,
GIR_EraseRootFromParent_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1211),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule2Enabled),
GIM_CheckConstantInt8, 0, 2, 0,
GIM_CheckCanReplaceReg, 0, 0, 0, 1,
GIR_ReplaceReg, 0, 0, 0, 1,
GIR_EraseRootFromParent_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1223),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule1Enabled),
GIR_DoneWithCustomAction, GIMT_Encode2(GICXXCustomAction_GICombiner1),
GIM_Reject,
GIM_Try, GIMT_Encode4(1247),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule18Enabled),
GIM_CheckCxxInsnPredicate, 0, GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner1),
GIM_CheckCanReplaceReg, 0, 0, 0, 1,
GIR_ReplaceReg, 0, 0, 0, 1,
GIR_EraseRootFromParent_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1271),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule11Enabled),
GIM_CheckCxxInsnPredicate, 0, GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner0),
GIM_CheckCanReplaceReg, 0, 0, 0, 1,
GIR_ReplaceReg, 0, 0, 0, 1,
GIR_EraseRootFromParent_Done,
GIM_Try, GIMT_Encode4(1291),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule19Enabled),
GIM_CheckCxxInsnPredicate, 0, GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner2),
GIR_BuildRootMI, GIMT_Encode2(TargetOpcode::G_FNEG),
GIR_RootToRootCopy, 0,
GIR_RootToRootCopy, 1,
GIR_EraseRootFromParent_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1321),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule9Enabled),
GIM_RecordInsnIgnoreCopies, 1, 0, 1,
GIM_CheckOpcode, 1, GIMT_Encode2(TargetOpcode::G_FNEG),
GIM_CheckCanReplaceReg, 0, 0, 1, 1,
GIM_CheckIsSafeToFold, 1,
GIR_ReplaceReg, 0, 0, 1, 1,
GIR_EraseRootFromParent_Done,
GIM_Reject,
GIM_Try, GIMT_Encode4(1343),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule17Enabled),
GIM_RecordInsnIgnoreCopies, 1, 0, 1,
GIM_CheckOpcode, 1, GIMT_Encode2(TargetOpcode::G_FPEXT),
GIM_CheckIsSafeToFold, 1,
GIR_DoneWithCustomAction, GIMT_Encode2(GICXXCustomAction_GICombiner9),
GIM_Reject,
GIM_Try, GIMT_Encode4(1367),
GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule2Enabled),
GIM_CheckConstantInt8, 0, 2, 0,
GIM_CheckCanReplaceReg, 0, 0, 0, 1,
GIR_ReplaceReg, 0, 0, 0, 1,
GIR_EraseRootFromParent_Done,
GIM_Reject,
GIM_Reject,
};
return MatchTable0;
}
#undef GIMT_Encode2
#undef GIMT_Encode4
#undef GIMT_Encode8
#endif
#ifdef GET_GICOMBINER_CONSTRUCTOR_INITS
AvailableModuleFeatures(computeAvailableModuleFeatures(&STI)),
AvailableFunctionFeatures()
#endif
#ifdef GET_GICOMBINER_CONSTRUCTOR_INITS
, State(0),
ExecInfo(TypeObjects, NumTypeObjects, FeatureBitsets, ComplexPredicateFns, CustomRenderers)
#endif