| 1 | /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |
| 2 | |* *| |
| 3 | |* AArch64PostLegalizerLoweringImpl Combiner Match Table *| |
| 4 | |* *| |
| 5 | |* Automatically generated file, do not edit! *| |
| 6 | |* *| |
| 7 | \*===----------------------------------------------------------------------===*/ |
| 8 | |
| 9 | #ifdef GET_GICOMBINER_DEPS |
| 10 | #include "llvm/ADT/SparseBitVector.h" |
| 11 | namespace llvm { |
| 12 | extern cl::OptionCategory GICombinerOptionCategory; |
| 13 | } // end namespace llvm |
| 14 | #endif // ifdef GET_GICOMBINER_DEPS |
| 15 | |
| 16 | #ifdef GET_GICOMBINER_TYPES |
| 17 | struct AArch64PostLegalizerLoweringImplRuleConfig { |
| 18 | SparseBitVector<> DisabledRules; |
| 19 | |
| 20 | bool isRuleEnabled(unsigned RuleID) const; |
| 21 | bool parseCommandLineOption(); |
| 22 | bool setRuleEnabled(StringRef RuleIdentifier); |
| 23 | bool setRuleDisabled(StringRef RuleIdentifier); |
| 24 | }; |
| 25 | |
| 26 | static std::optional<uint64_t> getRuleIdxForIdentifier(StringRef RuleIdentifier) { |
| 27 | uint64_t I; |
| 28 | // getAtInteger(...) returns false on success |
| 29 | bool Parsed = !RuleIdentifier.getAsInteger(0, I); |
| 30 | if (Parsed) |
| 31 | return I; |
| 32 | |
| 33 | #ifndef NDEBUG |
| 34 | switch (RuleIdentifier.size()) { |
| 35 | default: break; |
| 36 | case 3: // 6 strings to match. |
| 37 | switch (RuleIdentifier[0]) { |
| 38 | default: break; |
| 39 | case 'd': // 1 string to match. |
| 40 | if (memcmp(RuleIdentifier.data()+1, "up" , 2) != 0) |
| 41 | break; |
| 42 | return 0; // "dup" |
| 43 | case 'e': // 1 string to match. |
| 44 | if (memcmp(RuleIdentifier.data()+1, "xt" , 2) != 0) |
| 45 | break; |
| 46 | return 3; // "ext" |
| 47 | case 'r': // 1 string to match. |
| 48 | if (memcmp(RuleIdentifier.data()+1, "ev" , 2) != 0) |
| 49 | break; |
| 50 | return 2; // "rev" |
| 51 | case 't': // 1 string to match. |
| 52 | if (memcmp(RuleIdentifier.data()+1, "rn" , 2) != 0) |
| 53 | break; |
| 54 | return 6; // "trn" |
| 55 | case 'u': // 1 string to match. |
| 56 | if (memcmp(RuleIdentifier.data()+1, "zp" , 2) != 0) |
| 57 | break; |
| 58 | return 5; // "uzp" |
| 59 | case 'z': // 1 string to match. |
| 60 | if (memcmp(RuleIdentifier.data()+1, "ip" , 2) != 0) |
| 61 | break; |
| 62 | return 4; // "zip" |
| 63 | } |
| 64 | break; |
| 65 | case 7: // 1 string to match. |
| 66 | if (memcmp(RuleIdentifier.data()+0, "fullrev" , 7) != 0) |
| 67 | break; |
| 68 | return 7; // "fullrev" |
| 69 | case 11: // 1 string to match. |
| 70 | if (memcmp(RuleIdentifier.data()+0, "shuf_to_ins" , 11) != 0) |
| 71 | break; |
| 72 | return 8; // "shuf_to_ins" |
| 73 | case 12: // 1 string to match. |
| 74 | if (memcmp(RuleIdentifier.data()+0, "form_duplane" , 12) != 0) |
| 75 | break; |
| 76 | return 1; // "form_duplane" |
| 77 | case 14: // 1 string to match. |
| 78 | if (memcmp(RuleIdentifier.data()+0, "lower_mulv2s64" , 14) != 0) |
| 79 | break; |
| 80 | return 19; // "lower_mulv2s64" |
| 81 | case 15: // 3 strings to match. |
| 82 | switch (RuleIdentifier[0]) { |
| 83 | default: break; |
| 84 | case 'a': // 1 string to match. |
| 85 | if (memcmp(RuleIdentifier.data()+1, "djust_icmp_imm" , 14) != 0) |
| 86 | break; |
| 87 | return 10; // "adjust_icmp_imm" |
| 88 | case 'f': // 1 string to match. |
| 89 | if (memcmp(RuleIdentifier.data()+1, "orm_truncstore" , 14) != 0) |
| 90 | break; |
| 91 | return 15; // "form_truncstore" |
| 92 | case 'v': // 1 string to match. |
| 93 | if (memcmp(RuleIdentifier.data()+1, "ashr_vlshr_imm" , 14) != 0) |
| 94 | break; |
| 95 | return 9; // "vashr_vlshr_imm" |
| 96 | } |
| 97 | break; |
| 98 | case 16: // 1 string to match. |
| 99 | if (memcmp(RuleIdentifier.data()+0, "unmerge_duplane8" , 16) != 0) |
| 100 | break; |
| 101 | return 22; // "unmerge_duplane8" |
| 102 | case 17: // 3 strings to match. |
| 103 | switch (RuleIdentifier[0]) { |
| 104 | default: break; |
| 105 | case 'l': // 1 string to match. |
| 106 | if (memcmp(RuleIdentifier.data()+1, "ower_vector_fcmp" , 16) != 0) |
| 107 | break; |
| 108 | return 14; // "lower_vector_fcmp" |
| 109 | case 'u': // 2 strings to match. |
| 110 | if (memcmp(RuleIdentifier.data()+1, "nmerge_duplane" , 14) != 0) |
| 111 | break; |
| 112 | switch (RuleIdentifier[15]) { |
| 113 | default: break; |
| 114 | case '1': // 1 string to match. |
| 115 | if (RuleIdentifier[16] != '6') |
| 116 | break; |
| 117 | return 23; // "unmerge_duplane16" |
| 118 | case '3': // 1 string to match. |
| 119 | if (RuleIdentifier[16] != '2') |
| 120 | break; |
| 121 | return 24; // "unmerge_duplane32" |
| 122 | } |
| 123 | break; |
| 124 | } |
| 125 | break; |
| 126 | case 18: // 2 strings to match. |
| 127 | switch (RuleIdentifier[0]) { |
| 128 | default: break; |
| 129 | case 'i': // 1 string to match. |
| 130 | if (memcmp(RuleIdentifier.data()+1, "nsertelt_nonconst" , 17) != 0) |
| 131 | break; |
| 132 | return 21; // "insertelt_nonconst" |
| 133 | case 's': // 1 string to match. |
| 134 | if (memcmp(RuleIdentifier.data()+1, "wap_icmp_operands" , 17) != 0) |
| 135 | break; |
| 136 | return 11; // "swap_icmp_operands" |
| 137 | } |
| 138 | break; |
| 139 | case 19: // 1 string to match. |
| 140 | if (memcmp(RuleIdentifier.data()+0, "build_vector_to_dup" , 19) != 0) |
| 141 | break; |
| 142 | return 12; // "build_vector_to_dup" |
| 143 | case 21: // 1 string to match. |
| 144 | if (memcmp(RuleIdentifier.data()+0, "fconstant_to_constant" , 21) != 0) |
| 145 | break; |
| 146 | return 16; // "fconstant_to_constant" |
| 147 | case 22: // 1 string to match. |
| 148 | if (memcmp(RuleIdentifier.data()+0, "unmerge_ext_to_unmerge" , 22) != 0) |
| 149 | break; |
| 150 | return 18; // "unmerge_ext_to_unmerge" |
| 151 | case 23: // 1 string to match. |
| 152 | if (memcmp(RuleIdentifier.data()+0, "vector_unmerge_lowering" , 23) != 0) |
| 153 | break; |
| 154 | return 20; // "vector_unmerge_lowering" |
| 155 | case 26: // 1 string to match. |
| 156 | if (memcmp(RuleIdentifier.data()+0, "vector_sext_inreg_to_shift" , 26) != 0) |
| 157 | break; |
| 158 | return 17; // "vector_sext_inreg_to_shift" |
| 159 | case 29: // 1 string to match. |
| 160 | if (memcmp(RuleIdentifier.data()+0, "build_vector_to_vector_insert" , 29) != 0) |
| 161 | break; |
| 162 | return 13; // "build_vector_to_vector_insert" |
| 163 | } |
| 164 | #endif // ifndef NDEBUG |
| 165 | |
| 166 | return std::nullopt; |
| 167 | } |
| 168 | static std::optional<std::pair<uint64_t, uint64_t>> getRuleRangeForIdentifier(StringRef RuleIdentifier) { |
| 169 | std::pair<StringRef, StringRef> RangePair = RuleIdentifier.split('-'); |
| 170 | if (!RangePair.second.empty()) { |
| 171 | const auto First = getRuleIdxForIdentifier(RangePair.first); |
| 172 | const auto Last = getRuleIdxForIdentifier(RangePair.second); |
| 173 | if (!First || !Last) |
| 174 | return std::nullopt; |
| 175 | if (First >= Last) |
| 176 | report_fatal_error("Beginning of range should be before end of range" ); |
| 177 | return {{*First, *Last + 1}}; |
| 178 | } |
| 179 | if (RangePair.first == "*" ) { |
| 180 | return {{0, 25}}; |
| 181 | } |
| 182 | const auto I = getRuleIdxForIdentifier(RangePair.first); |
| 183 | if (!I) |
| 184 | return std::nullopt; |
| 185 | return {{*I, *I + 1}}; |
| 186 | } |
| 187 | |
| 188 | bool AArch64PostLegalizerLoweringImplRuleConfig::setRuleEnabled(StringRef RuleIdentifier) { |
| 189 | auto MaybeRange = getRuleRangeForIdentifier(RuleIdentifier); |
| 190 | if (!MaybeRange) |
| 191 | return false; |
| 192 | for (auto I = MaybeRange->first; I < MaybeRange->second; ++I) |
| 193 | DisabledRules.reset(I); |
| 194 | return true; |
| 195 | } |
| 196 | |
| 197 | bool AArch64PostLegalizerLoweringImplRuleConfig::setRuleDisabled(StringRef RuleIdentifier) { |
| 198 | auto MaybeRange = getRuleRangeForIdentifier(RuleIdentifier); |
| 199 | if (!MaybeRange) |
| 200 | return false; |
| 201 | for (auto I = MaybeRange->first; I < MaybeRange->second; ++I) |
| 202 | DisabledRules.set(I); |
| 203 | return true; |
| 204 | } |
| 205 | |
| 206 | static std::vector<std::string> AArch64PostLegalizerLoweringOption; |
| 207 | static cl::list<std::string> AArch64PostLegalizerLoweringDisableOption( |
| 208 | "aarch64postlegalizerlowering-disable-rule" , |
| 209 | cl::desc("Disable one or more combiner rules temporarily in the AArch64PostLegalizerLowering pass" ), |
| 210 | cl::CommaSeparated, |
| 211 | cl::Hidden, |
| 212 | cl::cat(GICombinerOptionCategory), |
| 213 | cl::callback([](const std::string &Str) { |
| 214 | AArch64PostLegalizerLoweringOption.push_back(Str); |
| 215 | })); |
| 216 | static cl::list<std::string> AArch64PostLegalizerLoweringOnlyEnableOption( |
| 217 | "aarch64postlegalizerlowering-only-enable-rule" , |
| 218 | cl::desc("Disable all rules in the AArch64PostLegalizerLowering pass then re-enable the specified ones" ), |
| 219 | cl::Hidden, |
| 220 | cl::cat(GICombinerOptionCategory), |
| 221 | cl::callback([](const std::string &CommaSeparatedArg) { |
| 222 | StringRef Str = CommaSeparatedArg; |
| 223 | AArch64PostLegalizerLoweringOption.push_back("*" ); |
| 224 | do { |
| 225 | auto X = Str.split("," ); |
| 226 | AArch64PostLegalizerLoweringOption.push_back(("!" + X.first).str()); |
| 227 | Str = X.second; |
| 228 | } while (!Str.empty()); |
| 229 | })); |
| 230 | |
| 231 | |
| 232 | bool AArch64PostLegalizerLoweringImplRuleConfig::isRuleEnabled(unsigned RuleID) const { |
| 233 | return !DisabledRules.test(RuleID); |
| 234 | } |
| 235 | bool AArch64PostLegalizerLoweringImplRuleConfig::parseCommandLineOption() { |
| 236 | for (StringRef Identifier : AArch64PostLegalizerLoweringOption) { |
| 237 | bool Enabled = Identifier.consume_front("!" ); |
| 238 | if (Enabled && !setRuleEnabled(Identifier)) |
| 239 | return false; |
| 240 | if (!Enabled && !setRuleDisabled(Identifier)) |
| 241 | return false; |
| 242 | } |
| 243 | return true; |
| 244 | } |
| 245 | |
| 246 | #endif // ifdef GET_GICOMBINER_TYPES |
| 247 | |
| 248 | #ifdef GET_GICOMBINER_TYPES |
| 249 | const unsigned MAX_SUBTARGET_PREDICATES = 0; |
| 250 | using PredicateBitset = llvm::Bitset<MAX_SUBTARGET_PREDICATES>; |
| 251 | #endif // ifdef GET_GICOMBINER_TYPES |
| 252 | |
| 253 | #ifdef GET_GICOMBINER_CLASS_MEMBERS |
| 254 | PredicateBitset AvailableModuleFeatures; |
| 255 | mutable PredicateBitset AvailableFunctionFeatures; |
| 256 | PredicateBitset getAvailableFeatures() const { |
| 257 | return AvailableModuleFeatures | AvailableFunctionFeatures; |
| 258 | } |
| 259 | PredicateBitset |
| 260 | computeAvailableModuleFeatures(const AArch64Subtarget *Subtarget) const; |
| 261 | PredicateBitset |
| 262 | computeAvailableFunctionFeatures(const AArch64Subtarget *Subtarget, |
| 263 | const MachineFunction *MF) const; |
| 264 | void setupGeneratedPerFunctionState(MachineFunction &MF) override; |
| 265 | #endif // ifdef GET_GICOMBINER_CLASS_MEMBERS |
| 266 | #ifdef GET_GICOMBINER_CLASS_MEMBERS |
| 267 | mutable MatcherState State; |
| 268 | typedef ComplexRendererFns(AArch64PostLegalizerLoweringImpl::*ComplexMatcherMemFn)(MachineOperand &) const; |
| 269 | typedef void(AArch64PostLegalizerLoweringImpl::*CustomRendererFn)(MachineInstrBuilder &, const MachineInstr &, int) const; |
| 270 | const ExecInfoTy<PredicateBitset, ComplexMatcherMemFn, CustomRendererFn> ExecInfo; |
| 271 | static AArch64PostLegalizerLoweringImpl::ComplexMatcherMemFn ComplexPredicateFns[]; |
| 272 | static AArch64PostLegalizerLoweringImpl::CustomRendererFn CustomRenderers[]; |
| 273 | bool testImmPredicate_I64(unsigned PredicateID, int64_t Imm) const override; |
| 274 | bool testImmPredicate_APInt(unsigned PredicateID, const APInt &Imm) const override; |
| 275 | bool testImmPredicate_APFloat(unsigned PredicateID, const APFloat &Imm) const override; |
| 276 | const uint8_t *getMatchTable() const override; |
| 277 | bool testMIPredicate_MI(unsigned PredicateID, const MachineInstr &MI, const MatcherState &State) const override; |
| 278 | bool testMOPredicate_MO(unsigned PredicateID, const MachineOperand &MO, const MatcherState &State) const override; |
| 279 | bool testSimplePredicate(unsigned PredicateID) const override; |
| 280 | bool runCustomAction(unsigned FnID, const MatcherState &State, NewMIVector &OutMIs) const override; |
| 281 | #endif // ifdef GET_GICOMBINER_CLASS_MEMBERS |
| 282 | |
| 283 | #ifdef GET_GICOMBINER_IMPL |
| 284 | // LLT Objects. |
| 285 | enum { |
| 286 | GILLT_s1, |
| 287 | }; |
| 288 | const static size_t NumTypeObjects = 1; |
| 289 | const static LLT TypeObjects[] = { |
| 290 | LLT::scalar(1), |
| 291 | }; |
| 292 | |
| 293 | // Bits for subtarget features that participate in instruction matching. |
| 294 | enum SubtargetFeatureBits : uint8_t { |
| 295 | }; |
| 296 | |
| 297 | PredicateBitset AArch64PostLegalizerLoweringImpl:: |
| 298 | computeAvailableModuleFeatures(const AArch64Subtarget *Subtarget) const { |
| 299 | PredicateBitset Features{}; |
| 300 | return Features; |
| 301 | } |
| 302 | |
| 303 | void AArch64PostLegalizerLoweringImpl::setupGeneratedPerFunctionState(MachineFunction &MF) { |
| 304 | AvailableFunctionFeatures = computeAvailableFunctionFeatures((const AArch64Subtarget *)&MF.getSubtarget(), &MF); |
| 305 | } |
| 306 | PredicateBitset AArch64PostLegalizerLoweringImpl:: |
| 307 | computeAvailableFunctionFeatures(const AArch64Subtarget *Subtarget, const MachineFunction *MF) const { |
| 308 | PredicateBitset Features{}; |
| 309 | return Features; |
| 310 | } |
| 311 | |
| 312 | // Feature bitsets. |
| 313 | enum { |
| 314 | GIFBS_Invalid, |
| 315 | }; |
| 316 | constexpr static PredicateBitset FeatureBitsets[] { |
| 317 | {}, // GIFBS_Invalid |
| 318 | }; |
| 319 | |
| 320 | // ComplexPattern predicates. |
| 321 | enum { |
| 322 | GICP_Invalid, |
| 323 | }; |
| 324 | // See constructor for table contents |
| 325 | |
| 326 | AArch64PostLegalizerLoweringImpl::ComplexMatcherMemFn |
| 327 | AArch64PostLegalizerLoweringImpl::ComplexPredicateFns[] = { |
| 328 | nullptr, // GICP_Invalid |
| 329 | }; |
| 330 | |
| 331 | enum { |
| 332 | GICXXPred_MI_Predicate_GICombiner0 = GICXXPred_Invalid + 1, |
| 333 | }; |
| 334 | bool AArch64PostLegalizerLoweringImpl::testMIPredicate_MI(unsigned PredicateID, const MachineInstr & MI, const MatcherState &State) const { |
| 335 | switch (PredicateID) { |
| 336 | case GICXXPred_MI_Predicate_GICombiner0: { |
| 337 | return MRI.getType(State.MIs[0]->getOperand(0).getReg()).getSizeInBits() == 64; |
| 338 | } |
| 339 | } |
| 340 | llvm_unreachable("Unknown predicate" ); |
| 341 | return false; |
| 342 | } |
| 343 | bool AArch64PostLegalizerLoweringImpl::testMOPredicate_MO(unsigned PredicateID, const MachineOperand & MO, const MatcherState &State) const { |
| 344 | llvm_unreachable("Unknown predicate" ); |
| 345 | return false; |
| 346 | } |
| 347 | bool AArch64PostLegalizerLoweringImpl::testImmPredicate_I64(unsigned PredicateID, int64_t Imm) const { |
| 348 | llvm_unreachable("Unknown predicate" ); |
| 349 | return false; |
| 350 | } |
| 351 | bool AArch64PostLegalizerLoweringImpl::testImmPredicate_APFloat(unsigned PredicateID, const APFloat & Imm) const { |
| 352 | llvm_unreachable("Unknown predicate" ); |
| 353 | return false; |
| 354 | } |
| 355 | bool AArch64PostLegalizerLoweringImpl::testImmPredicate_APInt(unsigned PredicateID, const APInt & Imm) const { |
| 356 | llvm_unreachable("Unknown predicate" ); |
| 357 | return false; |
| 358 | } |
| 359 | enum { |
| 360 | GICXXPred_Simple_IsRule0Enabled = GICXXPred_Invalid + 1, |
| 361 | GICXXPred_Simple_IsRule1Enabled, |
| 362 | GICXXPred_Simple_IsRule2Enabled, |
| 363 | GICXXPred_Simple_IsRule3Enabled, |
| 364 | GICXXPred_Simple_IsRule4Enabled, |
| 365 | GICXXPred_Simple_IsRule5Enabled, |
| 366 | GICXXPred_Simple_IsRule6Enabled, |
| 367 | GICXXPred_Simple_IsRule7Enabled, |
| 368 | GICXXPred_Simple_IsRule8Enabled, |
| 369 | GICXXPred_Simple_IsRule9Enabled, |
| 370 | GICXXPred_Simple_IsRule10Enabled, |
| 371 | GICXXPred_Simple_IsRule11Enabled, |
| 372 | GICXXPred_Simple_IsRule12Enabled, |
| 373 | GICXXPred_Simple_IsRule13Enabled, |
| 374 | GICXXPred_Simple_IsRule14Enabled, |
| 375 | GICXXPred_Simple_IsRule15Enabled, |
| 376 | GICXXPred_Simple_IsRule16Enabled, |
| 377 | GICXXPred_Simple_IsRule17Enabled, |
| 378 | GICXXPred_Simple_IsRule18Enabled, |
| 379 | GICXXPred_Simple_IsRule19Enabled, |
| 380 | GICXXPred_Simple_IsRule20Enabled, |
| 381 | GICXXPred_Simple_IsRule21Enabled, |
| 382 | GICXXPred_Simple_IsRule22Enabled, |
| 383 | GICXXPred_Simple_IsRule23Enabled, |
| 384 | GICXXPred_Simple_IsRule24Enabled, |
| 385 | }; |
| 386 | |
| 387 | bool AArch64PostLegalizerLoweringImpl::testSimplePredicate(unsigned Predicate) const { |
| 388 | return RuleConfig.isRuleEnabled(Predicate - GICXXPred_Invalid - 1); |
| 389 | } |
| 390 | // Custom renderers. |
| 391 | enum { |
| 392 | GICR_Invalid, |
| 393 | }; |
| 394 | AArch64PostLegalizerLoweringImpl::CustomRendererFn |
| 395 | AArch64PostLegalizerLoweringImpl::CustomRenderers[] = { |
| 396 | nullptr, // GICR_Invalid |
| 397 | }; |
| 398 | |
| 399 | bool AArch64PostLegalizerLoweringImpl::tryCombineAll(MachineInstr &I) const { |
| 400 | const TargetSubtargetInfo &ST = MF.getSubtarget(); |
| 401 | const PredicateBitset AvailableFeatures = getAvailableFeatures(); |
| 402 | B.setInstrAndDebugLoc(I); |
| 403 | State.MIs.clear(); |
| 404 | State.MIs.push_back(&I); |
| 405 | if (executeMatchTable(*this, State, ExecInfo, B, getMatchTable(), *ST.getInstrInfo(), MRI, *MRI.getTargetRegisterInfo(), *ST.getRegBankInfo(), AvailableFeatures, /*CoverageInfo*/ nullptr)) { |
| 406 | return true; |
| 407 | } |
| 408 | |
| 409 | return false; |
| 410 | } |
| 411 | |
| 412 | enum { |
| 413 | GICXXCustomAction_GICombiner0 = GICXXCustomAction_Invalid + 1, |
| 414 | GICXXCustomAction_GICombiner1, |
| 415 | GICXXCustomAction_GICombiner2, |
| 416 | GICXXCustomAction_GICombiner3, |
| 417 | GICXXCustomAction_GICombiner4, |
| 418 | GICXXCustomAction_GICombiner5, |
| 419 | GICXXCustomAction_GICombiner6, |
| 420 | GICXXCustomAction_GICombiner7, |
| 421 | GICXXCustomAction_GICombiner8, |
| 422 | GICXXCustomAction_GICombiner9, |
| 423 | GICXXCustomAction_GICombiner10, |
| 424 | GICXXCustomAction_GICombiner11, |
| 425 | GICXXCustomAction_GICombiner12, |
| 426 | GICXXCustomAction_GICombiner13, |
| 427 | GICXXCustomAction_GICombiner14, |
| 428 | GICXXCustomAction_GICombiner15, |
| 429 | GICXXCustomAction_GICombiner16, |
| 430 | GICXXCustomAction_GICombiner17, |
| 431 | GICXXCustomAction_GICombiner18, |
| 432 | GICXXCustomAction_GICombiner19, |
| 433 | GICXXCustomAction_GICombiner20, |
| 434 | GICXXCustomAction_GICombiner21, |
| 435 | }; |
| 436 | bool AArch64PostLegalizerLoweringImpl::runCustomAction(unsigned ApplyID, const MatcherState &State, NewMIVector &OutMIs) const { |
| 437 | Helper.getBuilder().setInstrAndDebugLoc(*State.MIs[0]); |
| 438 | switch(ApplyID) { |
| 439 | case GICXXCustomAction_GICombiner0:{ |
| 440 | ShuffleVectorPseudo GIMatchData_matchinfo; |
| 441 | // Match Patterns |
| 442 | if(![&](){return matchDup(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) { |
| 443 | return false; |
| 444 | } |
| 445 | // Apply Patterns |
| 446 | applyShuffleVectorPseudo(*State.MIs[0], GIMatchData_matchinfo); |
| 447 | return true; |
| 448 | } |
| 449 | case GICXXCustomAction_GICombiner1:{ |
| 450 | std::pair<unsigned, int> GIMatchData_matchinfo; |
| 451 | // Match Patterns |
| 452 | if(![&](){return matchDupLane(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) { |
| 453 | return false; |
| 454 | } |
| 455 | // Apply Patterns |
| 456 | applyDupLane(*State.MIs[0], MRI, B, GIMatchData_matchinfo); |
| 457 | return true; |
| 458 | } |
| 459 | case GICXXCustomAction_GICombiner2:{ |
| 460 | ShuffleVectorPseudo GIMatchData_matchinfo; |
| 461 | // Match Patterns |
| 462 | if(![&](){return matchREV(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) { |
| 463 | return false; |
| 464 | } |
| 465 | // Apply Patterns |
| 466 | applyShuffleVectorPseudo(*State.MIs[0], GIMatchData_matchinfo); |
| 467 | return true; |
| 468 | } |
| 469 | case GICXXCustomAction_GICombiner3:{ |
| 470 | ShuffleVectorPseudo GIMatchData_matchinfo; |
| 471 | // Match Patterns |
| 472 | if(![&](){return matchEXT(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) { |
| 473 | return false; |
| 474 | } |
| 475 | // Apply Patterns |
| 476 | applyEXT(*State.MIs[0], GIMatchData_matchinfo); |
| 477 | return true; |
| 478 | } |
| 479 | case GICXXCustomAction_GICombiner4:{ |
| 480 | ShuffleVectorPseudo GIMatchData_matchinfo; |
| 481 | // Match Patterns |
| 482 | if(![&](){return matchZip(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) { |
| 483 | return false; |
| 484 | } |
| 485 | // Apply Patterns |
| 486 | applyShuffleVectorPseudo(*State.MIs[0], GIMatchData_matchinfo); |
| 487 | return true; |
| 488 | } |
| 489 | case GICXXCustomAction_GICombiner5:{ |
| 490 | ShuffleVectorPseudo GIMatchData_matchinfo; |
| 491 | // Match Patterns |
| 492 | if(![&](){return matchUZP(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) { |
| 493 | return false; |
| 494 | } |
| 495 | // Apply Patterns |
| 496 | applyShuffleVectorPseudo(*State.MIs[0], GIMatchData_matchinfo); |
| 497 | return true; |
| 498 | } |
| 499 | case GICXXCustomAction_GICombiner6:{ |
| 500 | ShuffleVectorPseudo GIMatchData_matchinfo; |
| 501 | // Match Patterns |
| 502 | if(![&](){return matchTRN(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) { |
| 503 | return false; |
| 504 | } |
| 505 | // Apply Patterns |
| 506 | applyShuffleVectorPseudo(*State.MIs[0], GIMatchData_matchinfo); |
| 507 | return true; |
| 508 | } |
| 509 | case GICXXCustomAction_GICombiner7:{ |
| 510 | ShuffleVectorPseudo GIMatchData_matchinfo; |
| 511 | // Match Patterns |
| 512 | if(![&](){return ShuffleVectorInst::isReverseMask(State.MIs[0]->getOperand(3).getShuffleMask(), |
| 513 | State.MIs[0]->getOperand(3).getShuffleMask().size());}()) { |
| 514 | return false; |
| 515 | } |
| 516 | // Apply Patterns |
| 517 | applyFullRev(*State.MIs[0], MRI); |
| 518 | return true; |
| 519 | } |
| 520 | case GICXXCustomAction_GICombiner8:{ |
| 521 | std::tuple<Register, int, Register, int> GIMatchData_matchinfo; |
| 522 | // Match Patterns |
| 523 | if(![&](){return matchINS(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) { |
| 524 | return false; |
| 525 | } |
| 526 | // Apply Patterns |
| 527 | applyINS(*State.MIs[0], MRI, B, GIMatchData_matchinfo); |
| 528 | return true; |
| 529 | } |
| 530 | case GICXXCustomAction_GICombiner9:{ |
| 531 | int64_t GIMatchData_matchinfo; |
| 532 | // Match Patterns |
| 533 | if(![&](){return matchVAshrLshrImm(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) { |
| 534 | return false; |
| 535 | } |
| 536 | // Apply Patterns |
| 537 | applyVAshrLshrImm(*State.MIs[0], MRI, GIMatchData_matchinfo); |
| 538 | return true; |
| 539 | } |
| 540 | case GICXXCustomAction_GICombiner10:{ |
| 541 | std::pair<uint64_t, CmpInst::Predicate> GIMatchData_matchinfo; |
| 542 | // Match Patterns |
| 543 | if(![&](){return matchAdjustICmpImmAndPred(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) { |
| 544 | return false; |
| 545 | } |
| 546 | // Apply Patterns |
| 547 | applyAdjustICmpImmAndPred(*State.MIs[0], GIMatchData_matchinfo, B, Observer); |
| 548 | return true; |
| 549 | } |
| 550 | case GICXXCustomAction_GICombiner11:{ |
| 551 | // Match Patterns |
| 552 | if(![&](){return trySwapICmpOperands(*State.MIs[0], MRI);}()) { |
| 553 | return false; |
| 554 | } |
| 555 | // Apply Patterns |
| 556 | applySwapICmpOperands(*State.MIs[0], Observer); |
| 557 | return true; |
| 558 | } |
| 559 | case GICXXCustomAction_GICombiner12:{ |
| 560 | // Match Patterns |
| 561 | if(![&](){return matchBuildVectorToDup(*State.MIs[0], MRI);}()) { |
| 562 | return false; |
| 563 | } |
| 564 | // Apply Patterns |
| 565 | applyBuildVectorToDup(*State.MIs[0], MRI, B); |
| 566 | return true; |
| 567 | } |
| 568 | case GICXXCustomAction_GICombiner13:{ |
| 569 | // Match Patterns |
| 570 | if(![&](){return matchLowerBuildToInsertVecElt(*State.MIs[0], MRI);}()) { |
| 571 | return false; |
| 572 | } |
| 573 | // Apply Patterns |
| 574 | applyLowerBuildToInsertVecElt(*State.MIs[0], MRI, B); |
| 575 | return true; |
| 576 | } |
| 577 | case GICXXCustomAction_GICombiner14:{ |
| 578 | // Match Patterns |
| 579 | if(![&](){return matchLowerVectorFCMP(*State.MIs[0], MRI, B);}()) { |
| 580 | return false; |
| 581 | } |
| 582 | // Apply Patterns |
| 583 | applyLowerVectorFCMP(*State.MIs[0], MRI, B); |
| 584 | return true; |
| 585 | } |
| 586 | case GICXXCustomAction_GICombiner15:{ |
| 587 | Register GIMatchData_matchinfo; |
| 588 | // Match Patterns |
| 589 | if(![&](){return matchFormTruncstore(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) { |
| 590 | return false; |
| 591 | } |
| 592 | // Apply Patterns |
| 593 | applyFormTruncstore(*State.MIs[0], MRI, B, Observer, GIMatchData_matchinfo); |
| 594 | return true; |
| 595 | } |
| 596 | case GICXXCustomAction_GICombiner16:{ |
| 597 | // Match Patterns |
| 598 | if(![&](){return matchFConstantToConstant(*State.MIs[0], MRI);}()) { |
| 599 | return false; |
| 600 | } |
| 601 | // Apply Patterns |
| 602 | applyFConstantToConstant(*State.MIs[0]); |
| 603 | return true; |
| 604 | } |
| 605 | case GICXXCustomAction_GICombiner17:{ |
| 606 | // Match Patterns |
| 607 | if(![&](){return matchVectorSextInReg(*State.MIs[0], MRI);}()) { |
| 608 | return false; |
| 609 | } |
| 610 | // Apply Patterns |
| 611 | applyVectorSextInReg(*State.MIs[0], MRI, B, Observer); |
| 612 | return true; |
| 613 | } |
| 614 | case GICXXCustomAction_GICombiner18:{ |
| 615 | Register GIMatchData_matchinfo; |
| 616 | // Match Patterns |
| 617 | if(![&](){return matchUnmergeExtToUnmerge(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) { |
| 618 | return false; |
| 619 | } |
| 620 | // Apply Patterns |
| 621 | applyUnmergeExtToUnmerge(*State.MIs[0], MRI, B, Observer, GIMatchData_matchinfo); |
| 622 | return true; |
| 623 | } |
| 624 | case GICXXCustomAction_GICombiner19:{ |
| 625 | // Match Patterns |
| 626 | if(![&](){return matchMulv2s64(*State.MIs[0], MRI);}()) { |
| 627 | return false; |
| 628 | } |
| 629 | // Apply Patterns |
| 630 | applyMulv2s64(*State.MIs[0], MRI, B, Observer); |
| 631 | return true; |
| 632 | } |
| 633 | case GICXXCustomAction_GICombiner20:{ |
| 634 | // Match Patterns |
| 635 | if(![&](){return matchScalarizeVectorUnmerge(*State.MIs[0], MRI);}()) { |
| 636 | return false; |
| 637 | } |
| 638 | // Apply Patterns |
| 639 | applyScalarizeVectorUnmerge(*State.MIs[0], MRI, B); |
| 640 | return true; |
| 641 | } |
| 642 | case GICXXCustomAction_GICombiner21:{ |
| 643 | ShuffleVectorPseudo GIMatchData_matchinfo; |
| 644 | // Match Patterns |
| 645 | if(![&](){return matchNonConstInsert(*State.MIs[0], MRI);}()) { |
| 646 | return false; |
| 647 | } |
| 648 | // Apply Patterns |
| 649 | applyNonConstInsert(*State.MIs[0], MRI, B); |
| 650 | return true; |
| 651 | } |
| 652 | } |
| 653 | llvm_unreachable("Unknown Apply Action" ); |
| 654 | } |
| 655 | #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ |
| 656 | #define GIMT_Encode2(Val) uint8_t(Val), uint8_t((Val) >> 8) |
| 657 | #define GIMT_Encode4(Val) uint8_t(Val), uint8_t((Val) >> 8), uint8_t((Val) >> 16), uint8_t((Val) >> 24) |
| 658 | #define GIMT_Encode8(Val) uint8_t(Val), uint8_t((Val) >> 8), uint8_t((Val) >> 16), uint8_t((Val) >> 24), uint8_t(uint64_t(Val) >> 32), uint8_t(uint64_t(Val) >> 40), uint8_t(uint64_t(Val) >> 48), uint8_t(uint64_t(Val) >> 56) |
| 659 | #else |
| 660 | #define GIMT_Encode2(Val) uint8_t((Val) >> 8), uint8_t(Val) |
| 661 | #define GIMT_Encode4(Val) uint8_t((Val) >> 24), uint8_t((Val) >> 16), uint8_t((Val) >> 8), uint8_t(Val) |
| 662 | #define GIMT_Encode8(Val) uint8_t(uint64_t(Val) >> 56), uint8_t(uint64_t(Val) >> 48), uint8_t(uint64_t(Val) >> 40), uint8_t(uint64_t(Val) >> 32), uint8_t((Val) >> 24), uint8_t((Val) >> 16), uint8_t((Val) >> 8), uint8_t(Val) |
| 663 | #endif |
| 664 | const uint8_t *AArch64PostLegalizerLoweringImpl::getMatchTable() const { |
| 665 | constexpr static uint8_t MatchTable0[] = { |
| 666 | /* 0 */ GIM_SwitchOpcode, /*MI*/0, /*[*/GIMT_Encode2(57), GIMT_Encode2(253), /*)*//*default:*//*Label 12*/ GIMT_Encode4(1211), |
| 667 | /* 10 */ /*TargetOpcode::G_MUL*//*Label 0*/ GIMT_Encode4(794), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), |
| 668 | /* 102 */ /*TargetOpcode::G_UNMERGE_VALUES*//*Label 1*/ GIMT_Encode4(806), GIMT_Encode4(0), GIMT_Encode4(0), |
| 669 | /* 114 */ /*TargetOpcode::G_BUILD_VECTOR*//*Label 2*/ GIMT_Encode4(968), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), |
| 670 | /* 202 */ /*TargetOpcode::G_STORE*//*Label 3*/ GIMT_Encode4(994), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), |
| 671 | /* 362 */ /*TargetOpcode::G_FCONSTANT*//*Label 4*/ GIMT_Encode4(1006), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), |
| 672 | /* 378 */ /*TargetOpcode::G_SEXT_INREG*//*Label 5*/ GIMT_Encode4(1018), GIMT_Encode4(0), GIMT_Encode4(0), |
| 673 | /* 390 */ /*TargetOpcode::G_LSHR*//*Label 6*/ GIMT_Encode4(1030), |
| 674 | /* 394 */ /*TargetOpcode::G_ASHR*//*Label 7*/ GIMT_Encode4(1042), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), |
| 675 | /* 414 */ /*TargetOpcode::G_ICMP*//*Label 8*/ GIMT_Encode4(1054), |
| 676 | /* 418 */ /*TargetOpcode::G_FCMP*//*Label 9*/ GIMT_Encode4(1077), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), |
| 677 | /* 782 */ /*TargetOpcode::G_INSERT_VECTOR_ELT*//*Label 10*/ GIMT_Encode4(1089), GIMT_Encode4(0), |
| 678 | /* 790 */ /*TargetOpcode::G_SHUFFLE_VECTOR*//*Label 11*/ GIMT_Encode4(1101), |
| 679 | /* 794 */ // Label 0: @794 |
| 680 | /* 794 */ GIM_Try, /*On fail goto*//*Label 13*/ GIMT_Encode4(805), // Rule ID 20 // |
| 681 | /* 799 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule19Enabled), |
| 682 | /* 802 */ // MIs[0] dst |
| 683 | /* 802 */ // No operand predicates |
| 684 | /* 802 */ // MIs[0] src1 |
| 685 | /* 802 */ // No operand predicates |
| 686 | /* 802 */ // MIs[0] src2 |
| 687 | /* 802 */ // No operand predicates |
| 688 | /* 802 */ // Combiner Rule #19: lower_mulv2s64 |
| 689 | /* 802 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner19), |
| 690 | /* 805 */ // Label 13: @805 |
| 691 | /* 805 */ GIM_Reject, |
| 692 | /* 806 */ // Label 1: @806 |
| 693 | /* 806 */ GIM_Try, /*On fail goto*//*Label 14*/ GIMT_Encode4(817), // Rule ID 19 // |
| 694 | /* 811 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule18Enabled), |
| 695 | /* 814 */ // Combiner Rule #18: unmerge_ext_to_unmerge; wip_match_opcode 'G_UNMERGE_VALUES' |
| 696 | /* 814 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner18), |
| 697 | /* 817 */ // Label 14: @817 |
| 698 | /* 817 */ GIM_Try, /*On fail goto*//*Label 15*/ GIMT_Encode4(828), // Rule ID 21 // |
| 699 | /* 822 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule20Enabled), |
| 700 | /* 825 */ // Combiner Rule #20: vector_unmerge_lowering; wip_match_opcode 'G_UNMERGE_VALUES' |
| 701 | /* 825 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner20), |
| 702 | /* 828 */ // Label 15: @828 |
| 703 | /* 828 */ GIM_Try, /*On fail goto*//*Label 16*/ GIMT_Encode4(967), |
| 704 | /* 833 */ GIM_CheckNumOperands, /*MI*/0, /*Expected*/3, |
| 705 | /* 836 */ GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner0), |
| 706 | /* 840 */ GIM_Try, /*On fail goto*//*Label 17*/ GIMT_Encode4(882), // Rule ID 24 // |
| 707 | /* 845 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule23Enabled), |
| 708 | /* 848 */ // MIs[0] d1 |
| 709 | /* 848 */ // No operand predicates |
| 710 | /* 848 */ // MIs[0] d2 |
| 711 | /* 848 */ // No operand predicates |
| 712 | /* 848 */ // MIs[0] a |
| 713 | /* 848 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1] |
| 714 | /* 852 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(AArch64::G_DUPLANE16), |
| 715 | /* 856 */ // MIs[1] src |
| 716 | /* 856 */ // No operand predicates |
| 717 | /* 856 */ // MIs[1] c |
| 718 | /* 856 */ // No operand predicates |
| 719 | /* 856 */ GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/1, /*NewInsnId*/0, /*NewOpIdx*/0, |
| 720 | /* 861 */ GIM_CheckIsSafeToFold, /*NumInsns*/1, |
| 721 | /* 863 */ // Combiner Rule #23: unmerge_duplane16 |
| 722 | /* 863 */ GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(AArch64::G_DUPLANE16), |
| 723 | /* 866 */ GIR_RootToRootCopy, /*OpIdx*/0, // d1 |
| 724 | /* 868 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src |
| 725 | /* 872 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/2, // c |
| 726 | /* 876 */ GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/1, /*NewInsnId*/0, /*NewOpIdx*/0, |
| 727 | /* 881 */ GIR_EraseRootFromParent_Done, |
| 728 | /* 882 */ // Label 17: @882 |
| 729 | /* 882 */ GIM_Try, /*On fail goto*//*Label 18*/ GIMT_Encode4(924), // Rule ID 25 // |
| 730 | /* 887 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule24Enabled), |
| 731 | /* 890 */ // MIs[0] d1 |
| 732 | /* 890 */ // No operand predicates |
| 733 | /* 890 */ // MIs[0] d2 |
| 734 | /* 890 */ // No operand predicates |
| 735 | /* 890 */ // MIs[0] a |
| 736 | /* 890 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1] |
| 737 | /* 894 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(AArch64::G_DUPLANE32), |
| 738 | /* 898 */ // MIs[1] src |
| 739 | /* 898 */ // No operand predicates |
| 740 | /* 898 */ // MIs[1] c |
| 741 | /* 898 */ // No operand predicates |
| 742 | /* 898 */ GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/1, /*NewInsnId*/0, /*NewOpIdx*/0, |
| 743 | /* 903 */ GIM_CheckIsSafeToFold, /*NumInsns*/1, |
| 744 | /* 905 */ // Combiner Rule #24: unmerge_duplane32 |
| 745 | /* 905 */ GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(AArch64::G_DUPLANE32), |
| 746 | /* 908 */ GIR_RootToRootCopy, /*OpIdx*/0, // d1 |
| 747 | /* 910 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src |
| 748 | /* 914 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/2, // c |
| 749 | /* 918 */ GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/1, /*NewInsnId*/0, /*NewOpIdx*/0, |
| 750 | /* 923 */ GIR_EraseRootFromParent_Done, |
| 751 | /* 924 */ // Label 18: @924 |
| 752 | /* 924 */ GIM_Try, /*On fail goto*//*Label 19*/ GIMT_Encode4(966), // Rule ID 23 // |
| 753 | /* 929 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule22Enabled), |
| 754 | /* 932 */ // MIs[0] d1 |
| 755 | /* 932 */ // No operand predicates |
| 756 | /* 932 */ // MIs[0] d2 |
| 757 | /* 932 */ // No operand predicates |
| 758 | /* 932 */ // MIs[0] a |
| 759 | /* 932 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1] |
| 760 | /* 936 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(AArch64::G_DUPLANE8), |
| 761 | /* 940 */ // MIs[1] src |
| 762 | /* 940 */ // No operand predicates |
| 763 | /* 940 */ // MIs[1] c |
| 764 | /* 940 */ // No operand predicates |
| 765 | /* 940 */ GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/1, /*NewInsnId*/0, /*NewOpIdx*/0, |
| 766 | /* 945 */ GIM_CheckIsSafeToFold, /*NumInsns*/1, |
| 767 | /* 947 */ // Combiner Rule #22: unmerge_duplane8 |
| 768 | /* 947 */ GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(AArch64::G_DUPLANE8), |
| 769 | /* 950 */ GIR_RootToRootCopy, /*OpIdx*/0, // d1 |
| 770 | /* 952 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src |
| 771 | /* 956 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/2, // c |
| 772 | /* 960 */ GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/1, /*NewInsnId*/0, /*NewOpIdx*/0, |
| 773 | /* 965 */ GIR_EraseRootFromParent_Done, |
| 774 | /* 966 */ // Label 19: @966 |
| 775 | /* 966 */ GIM_Reject, |
| 776 | /* 967 */ // Label 16: @967 |
| 777 | /* 967 */ GIM_Reject, |
| 778 | /* 968 */ // Label 2: @968 |
| 779 | /* 968 */ GIM_Try, /*On fail goto*//*Label 20*/ GIMT_Encode4(979), // Rule ID 13 // |
| 780 | /* 973 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule12Enabled), |
| 781 | /* 976 */ // Combiner Rule #12: build_vector_to_dup; wip_match_opcode 'G_BUILD_VECTOR' |
| 782 | /* 976 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner12), |
| 783 | /* 979 */ // Label 20: @979 |
| 784 | /* 979 */ GIM_Try, /*On fail goto*//*Label 21*/ GIMT_Encode4(993), // Rule ID 14 // |
| 785 | /* 984 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule13Enabled), |
| 786 | /* 987 */ GIM_CheckNumOperandsGE, /*MI*/0, /*Expected*/2, |
| 787 | /* 990 */ // MIs[0] dst |
| 788 | /* 990 */ // No operand predicates |
| 789 | /* 990 */ // MIs[0] unused |
| 790 | /* 990 */ // No operand predicates |
| 791 | /* 990 */ // Combiner Rule #13: build_vector_to_vector_insert |
| 792 | /* 990 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner13), |
| 793 | /* 993 */ // Label 21: @993 |
| 794 | /* 993 */ GIM_Reject, |
| 795 | /* 994 */ // Label 3: @994 |
| 796 | /* 994 */ GIM_Try, /*On fail goto*//*Label 22*/ GIMT_Encode4(1005), // Rule ID 16 // |
| 797 | /* 999 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule15Enabled), |
| 798 | /* 1002 */ // MIs[0] src |
| 799 | /* 1002 */ // No operand predicates |
| 800 | /* 1002 */ // MIs[0] addr |
| 801 | /* 1002 */ // No operand predicates |
| 802 | /* 1002 */ // Combiner Rule #15: form_truncstore |
| 803 | /* 1002 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner15), |
| 804 | /* 1005 */ // Label 22: @1005 |
| 805 | /* 1005 */ GIM_Reject, |
| 806 | /* 1006 */ // Label 4: @1006 |
| 807 | /* 1006 */ GIM_Try, /*On fail goto*//*Label 23*/ GIMT_Encode4(1017), // Rule ID 17 // |
| 808 | /* 1011 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule16Enabled), |
| 809 | /* 1014 */ // MIs[0] dst |
| 810 | /* 1014 */ // No operand predicates |
| 811 | /* 1014 */ // MIs[0] src |
| 812 | /* 1014 */ // No operand predicates |
| 813 | /* 1014 */ // Combiner Rule #16: fconstant_to_constant |
| 814 | /* 1014 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner16), |
| 815 | /* 1017 */ // Label 23: @1017 |
| 816 | /* 1017 */ GIM_Reject, |
| 817 | /* 1018 */ // Label 5: @1018 |
| 818 | /* 1018 */ GIM_Try, /*On fail goto*//*Label 24*/ GIMT_Encode4(1029), // Rule ID 18 // |
| 819 | /* 1023 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule17Enabled), |
| 820 | /* 1026 */ // Combiner Rule #17: vector_sext_inreg_to_shift; wip_match_opcode 'G_SEXT_INREG' |
| 821 | /* 1026 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner17), |
| 822 | /* 1029 */ // Label 24: @1029 |
| 823 | /* 1029 */ GIM_Reject, |
| 824 | /* 1030 */ // Label 6: @1030 |
| 825 | /* 1030 */ GIM_Try, /*On fail goto*//*Label 25*/ GIMT_Encode4(1041), // Rule ID 10 // |
| 826 | /* 1035 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule9Enabled), |
| 827 | /* 1038 */ // Combiner Rule #9: vashr_vlshr_imm; wip_match_opcode 'G_LSHR' |
| 828 | /* 1038 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner9), |
| 829 | /* 1041 */ // Label 25: @1041 |
| 830 | /* 1041 */ GIM_Reject, |
| 831 | /* 1042 */ // Label 7: @1042 |
| 832 | /* 1042 */ GIM_Try, /*On fail goto*//*Label 26*/ GIMT_Encode4(1053), // Rule ID 9 // |
| 833 | /* 1047 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule9Enabled), |
| 834 | /* 1050 */ // Combiner Rule #9: vashr_vlshr_imm; wip_match_opcode 'G_ASHR' |
| 835 | /* 1050 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner9), |
| 836 | /* 1053 */ // Label 26: @1053 |
| 837 | /* 1053 */ GIM_Reject, |
| 838 | /* 1054 */ // Label 8: @1054 |
| 839 | /* 1054 */ GIM_Try, /*On fail goto*//*Label 27*/ GIMT_Encode4(1065), // Rule ID 11 // |
| 840 | /* 1059 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule10Enabled), |
| 841 | /* 1062 */ // MIs[0] dst |
| 842 | /* 1062 */ // No operand predicates |
| 843 | /* 1062 */ // MIs[0] tst |
| 844 | /* 1062 */ // No operand predicates |
| 845 | /* 1062 */ // MIs[0] src1 |
| 846 | /* 1062 */ // No operand predicates |
| 847 | /* 1062 */ // MIs[0] src2 |
| 848 | /* 1062 */ // No operand predicates |
| 849 | /* 1062 */ // Combiner Rule #10: adjust_icmp_imm |
| 850 | /* 1062 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner10), |
| 851 | /* 1065 */ // Label 27: @1065 |
| 852 | /* 1065 */ GIM_Try, /*On fail goto*//*Label 28*/ GIMT_Encode4(1076), // Rule ID 12 // |
| 853 | /* 1070 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule11Enabled), |
| 854 | /* 1073 */ // MIs[0] dst |
| 855 | /* 1073 */ // No operand predicates |
| 856 | /* 1073 */ // MIs[0] tst |
| 857 | /* 1073 */ // No operand predicates |
| 858 | /* 1073 */ // MIs[0] src1 |
| 859 | /* 1073 */ // No operand predicates |
| 860 | /* 1073 */ // MIs[0] src2 |
| 861 | /* 1073 */ // No operand predicates |
| 862 | /* 1073 */ // Combiner Rule #11: swap_icmp_operands |
| 863 | /* 1073 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner11), |
| 864 | /* 1076 */ // Label 28: @1076 |
| 865 | /* 1076 */ GIM_Reject, |
| 866 | /* 1077 */ // Label 9: @1077 |
| 867 | /* 1077 */ GIM_Try, /*On fail goto*//*Label 29*/ GIMT_Encode4(1088), // Rule ID 15 // |
| 868 | /* 1082 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule14Enabled), |
| 869 | /* 1085 */ // MIs[0] dst |
| 870 | /* 1085 */ // No operand predicates |
| 871 | /* 1085 */ // MIs[0] tst |
| 872 | /* 1085 */ // No operand predicates |
| 873 | /* 1085 */ // MIs[0] src1 |
| 874 | /* 1085 */ // No operand predicates |
| 875 | /* 1085 */ // MIs[0] src2 |
| 876 | /* 1085 */ // No operand predicates |
| 877 | /* 1085 */ // Combiner Rule #14: lower_vector_fcmp |
| 878 | /* 1085 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner14), |
| 879 | /* 1088 */ // Label 29: @1088 |
| 880 | /* 1088 */ GIM_Reject, |
| 881 | /* 1089 */ // Label 10: @1089 |
| 882 | /* 1089 */ GIM_Try, /*On fail goto*//*Label 30*/ GIMT_Encode4(1100), // Rule ID 22 // |
| 883 | /* 1094 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule21Enabled), |
| 884 | /* 1097 */ // Combiner Rule #21: insertelt_nonconst; wip_match_opcode 'G_INSERT_VECTOR_ELT' |
| 885 | /* 1097 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner21), |
| 886 | /* 1100 */ // Label 30: @1100 |
| 887 | /* 1100 */ GIM_Reject, |
| 888 | /* 1101 */ // Label 11: @1101 |
| 889 | /* 1101 */ GIM_Try, /*On fail goto*//*Label 31*/ GIMT_Encode4(1112), // Rule ID 0 // |
| 890 | /* 1106 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule0Enabled), |
| 891 | /* 1109 */ // Combiner Rule #0: dup; wip_match_opcode 'G_SHUFFLE_VECTOR' |
| 892 | /* 1109 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner0), |
| 893 | /* 1112 */ // Label 31: @1112 |
| 894 | /* 1112 */ GIM_Try, /*On fail goto*//*Label 32*/ GIMT_Encode4(1123), // Rule ID 1 // |
| 895 | /* 1117 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule1Enabled), |
| 896 | /* 1120 */ // Combiner Rule #1: form_duplane; wip_match_opcode 'G_SHUFFLE_VECTOR' |
| 897 | /* 1120 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner1), |
| 898 | /* 1123 */ // Label 32: @1123 |
| 899 | /* 1123 */ GIM_Try, /*On fail goto*//*Label 33*/ GIMT_Encode4(1134), // Rule ID 2 // |
| 900 | /* 1128 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule2Enabled), |
| 901 | /* 1131 */ // Combiner Rule #2: rev; wip_match_opcode 'G_SHUFFLE_VECTOR' |
| 902 | /* 1131 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner2), |
| 903 | /* 1134 */ // Label 33: @1134 |
| 904 | /* 1134 */ GIM_Try, /*On fail goto*//*Label 34*/ GIMT_Encode4(1145), // Rule ID 3 // |
| 905 | /* 1139 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule3Enabled), |
| 906 | /* 1142 */ // Combiner Rule #3: ext; wip_match_opcode 'G_SHUFFLE_VECTOR' |
| 907 | /* 1142 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner3), |
| 908 | /* 1145 */ // Label 34: @1145 |
| 909 | /* 1145 */ GIM_Try, /*On fail goto*//*Label 35*/ GIMT_Encode4(1156), // Rule ID 4 // |
| 910 | /* 1150 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule4Enabled), |
| 911 | /* 1153 */ // Combiner Rule #4: zip; wip_match_opcode 'G_SHUFFLE_VECTOR' |
| 912 | /* 1153 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner4), |
| 913 | /* 1156 */ // Label 35: @1156 |
| 914 | /* 1156 */ GIM_Try, /*On fail goto*//*Label 36*/ GIMT_Encode4(1167), // Rule ID 5 // |
| 915 | /* 1161 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule5Enabled), |
| 916 | /* 1164 */ // Combiner Rule #5: uzp; wip_match_opcode 'G_SHUFFLE_VECTOR' |
| 917 | /* 1164 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner5), |
| 918 | /* 1167 */ // Label 36: @1167 |
| 919 | /* 1167 */ GIM_Try, /*On fail goto*//*Label 37*/ GIMT_Encode4(1178), // Rule ID 6 // |
| 920 | /* 1172 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule6Enabled), |
| 921 | /* 1175 */ // Combiner Rule #6: trn; wip_match_opcode 'G_SHUFFLE_VECTOR' |
| 922 | /* 1175 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner6), |
| 923 | /* 1178 */ // Label 37: @1178 |
| 924 | /* 1178 */ GIM_Try, /*On fail goto*//*Label 38*/ GIMT_Encode4(1189), // Rule ID 8 // |
| 925 | /* 1183 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule8Enabled), |
| 926 | /* 1186 */ // Combiner Rule #8: shuf_to_ins; wip_match_opcode 'G_SHUFFLE_VECTOR' |
| 927 | /* 1186 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner8), |
| 928 | /* 1189 */ // Label 38: @1189 |
| 929 | /* 1189 */ GIM_Try, /*On fail goto*//*Label 39*/ GIMT_Encode4(1210), // Rule ID 7 // |
| 930 | /* 1194 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule7Enabled), |
| 931 | /* 1197 */ // MIs[0] src |
| 932 | /* 1197 */ // No operand predicates |
| 933 | /* 1197 */ // MIs[0] src1 |
| 934 | /* 1197 */ // No operand predicates |
| 935 | /* 1197 */ // MIs[0] src2 |
| 936 | /* 1197 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1] |
| 937 | /* 1201 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_IMPLICIT_DEF), |
| 938 | /* 1205 */ // MIs[0] mask |
| 939 | /* 1205 */ // No operand predicates |
| 940 | /* 1205 */ GIM_CheckIsSafeToFold, /*NumInsns*/1, |
| 941 | /* 1207 */ // Combiner Rule #7: fullrev |
| 942 | /* 1207 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner7), |
| 943 | /* 1210 */ // Label 39: @1210 |
| 944 | /* 1210 */ GIM_Reject, |
| 945 | /* 1211 */ // Label 12: @1211 |
| 946 | /* 1211 */ GIM_Reject, |
| 947 | /* 1212 */ }; // Size: 1212 bytes |
| 948 | return MatchTable0; |
| 949 | } |
| 950 | #undef GIMT_Encode2 |
| 951 | #undef GIMT_Encode4 |
| 952 | #undef GIMT_Encode8 |
| 953 | |
| 954 | #endif // ifdef GET_GICOMBINER_IMPL |
| 955 | |
| 956 | #ifdef GET_GICOMBINER_CONSTRUCTOR_INITS |
| 957 | AvailableModuleFeatures(computeAvailableModuleFeatures(&STI)), |
| 958 | AvailableFunctionFeatures() |
| 959 | #endif // ifdef GET_GICOMBINER_CONSTRUCTOR_INITS |
| 960 | #ifdef GET_GICOMBINER_CONSTRUCTOR_INITS |
| 961 | , State(0), |
| 962 | ExecInfo(TypeObjects, NumTypeObjects, FeatureBitsets, ComplexPredicateFns, CustomRenderers) |
| 963 | #endif // ifdef GET_GICOMBINER_CONSTRUCTOR_INITS |
| 964 | |
| 965 | |