| 1 | /*===- TableGen'erated file -------------------------------------*- C++ -*-===*\ |
| 2 | |* *| |
| 3 | |* AArch64O0PreLegalizerCombinerImpl Combiner Match Table *| |
| 4 | |* *| |
| 5 | |* Automatically generated file, do not edit! *| |
| 6 | |* *| |
| 7 | \*===----------------------------------------------------------------------===*/ |
| 8 | |
| 9 | #ifdef GET_GICOMBINER_DEPS |
| 10 | |
| 11 | #include "llvm/ADT/SparseBitVector.h" |
| 12 | namespace llvm { |
| 13 | |
| 14 | extern cl::OptionCategory GICombinerOptionCategory; |
| 15 | |
| 16 | } // namespace llvm |
| 17 | |
| 18 | #endif // GET_GICOMBINER_DEPS |
| 19 | |
| 20 | #ifdef GET_GICOMBINER_TYPES |
| 21 | |
| 22 | struct AArch64O0PreLegalizerCombinerImplRuleConfig { |
| 23 | SparseBitVector<> DisabledRules; |
| 24 | |
| 25 | bool isRuleEnabled(unsigned RuleID) const; |
| 26 | bool parseCommandLineOption(); |
| 27 | bool setRuleEnabled(StringRef RuleIdentifier); |
| 28 | bool setRuleDisabled(StringRef RuleIdentifier); |
| 29 | }; |
| 30 | |
| 31 | static std::optional<uint64_t> getRuleIdxForIdentifier(StringRef RuleIdentifier) { |
| 32 | uint64_t I; |
| 33 | // getAtInteger(...) returns false on success |
| 34 | bool Parsed = !RuleIdentifier.getAsInteger(0, I); |
| 35 | if (Parsed) |
| 36 | return I; |
| 37 | |
| 38 | #ifndef NDEBUG |
| 39 | switch (RuleIdentifier.size()) { |
| 40 | default: break; |
| 41 | case 9: // 1 string to match. |
| 42 | if (memcmp(RuleIdentifier.data()+0, "copy_prop" , 9) != 0) |
| 43 | break; |
| 44 | return 0; // "copy_prop" |
| 45 | case 10: // 3 strings to match. |
| 46 | switch (RuleIdentifier[0]) { |
| 47 | default: break; |
| 48 | case 'e': // 1 string to match. |
| 49 | if (memcmp(RuleIdentifier.data()+1, "mit_bzero" , 9) != 0) |
| 50 | break; |
| 51 | return 17; // "emit_bzero" |
| 52 | case 'm': // 1 string to match. |
| 53 | if (memcmp(RuleIdentifier.data()+1, "ul_to_shl" , 9) != 0) |
| 54 | break; |
| 55 | return 1; // "mul_to_shl" |
| 56 | case 's': // 1 string to match. |
| 57 | if (memcmp(RuleIdentifier.data()+1, "ub_to_add" , 9) != 0) |
| 58 | break; |
| 59 | return 2; // "sub_to_add" |
| 60 | } |
| 61 | break; |
| 62 | case 12: // 1 string to match. |
| 63 | if (memcmp(RuleIdentifier.data()+0, "not_cmp_fold" , 12) != 0) |
| 64 | break; |
| 65 | return 9; // "not_cmp_fold" |
| 66 | case 13: // 1 string to match. |
| 67 | if (memcmp(RuleIdentifier.data()+0, "load_and_mask" , 13) != 0) |
| 68 | break; |
| 69 | return 8; // "load_and_mask" |
| 70 | case 14: // 3 strings to match. |
| 71 | switch (RuleIdentifier[0]) { |
| 72 | default: break; |
| 73 | case 'c': // 2 strings to match. |
| 74 | if (memcmp(RuleIdentifier.data()+1, "ombine_mem" , 10) != 0) |
| 75 | break; |
| 76 | switch (RuleIdentifier[11]) { |
| 77 | default: break; |
| 78 | case 'c': // 1 string to match. |
| 79 | if (memcmp(RuleIdentifier.data()+12, "py" , 2) != 0) |
| 80 | break; |
| 81 | return 14; // "combine_memcpy" |
| 82 | case 's': // 1 string to match. |
| 83 | if (memcmp(RuleIdentifier.data()+12, "et" , 2) != 0) |
| 84 | break; |
| 85 | return 16; // "combine_memset" |
| 86 | } |
| 87 | break; |
| 88 | case 'm': // 1 string to match. |
| 89 | if (memcmp(RuleIdentifier.data()+1, "ul_by_neg_one" , 13) != 0) |
| 90 | break; |
| 91 | return 4; // "mul_by_neg_one" |
| 92 | } |
| 93 | break; |
| 94 | case 15: // 3 strings to match. |
| 95 | switch (RuleIdentifier[0]) { |
| 96 | default: break; |
| 97 | case 'c': // 1 string to match. |
| 98 | if (memcmp(RuleIdentifier.data()+1, "ombine_memmove" , 14) != 0) |
| 99 | break; |
| 100 | return 15; // "combine_memmove" |
| 101 | case 'e': // 1 string to match. |
| 102 | if (memcmp(RuleIdentifier.data()+1, "xtending_loads" , 14) != 0) |
| 103 | break; |
| 104 | return 7; // "extending_loads" |
| 105 | case 'i': // 1 string to match. |
| 106 | if (memcmp(RuleIdentifier.data()+1, "dempotent_prop" , 14) != 0) |
| 107 | break; |
| 108 | return 5; // "idempotent_prop" |
| 109 | } |
| 110 | break; |
| 111 | case 17: // 1 string to match. |
| 112 | if (memcmp(RuleIdentifier.data()+0, "add_p2i_to_ptradd" , 17) != 0) |
| 113 | break; |
| 114 | return 3; // "add_p2i_to_ptradd" |
| 115 | case 19: // 1 string to match. |
| 116 | if (memcmp(RuleIdentifier.data()+0, "ptr_add_immed_chain" , 19) != 0) |
| 117 | break; |
| 118 | return 6; // "ptr_add_immed_chain" |
| 119 | case 21: // 3 strings to match. |
| 120 | if (memcmp(RuleIdentifier.data()+0, "combine_" , 8) != 0) |
| 121 | break; |
| 122 | switch (RuleIdentifier[8]) { |
| 123 | default: break; |
| 124 | case 'c': // 1 string to match. |
| 125 | if (memcmp(RuleIdentifier.data()+9, "oncat_vector" , 12) != 0) |
| 126 | break; |
| 127 | return 10; // "combine_concat_vector" |
| 128 | case 'm': // 2 strings to match. |
| 129 | if (memcmp(RuleIdentifier.data()+9, "em" , 2) != 0) |
| 130 | break; |
| 131 | switch (RuleIdentifier[11]) { |
| 132 | default: break; |
| 133 | case 'c': // 1 string to match. |
| 134 | if (memcmp(RuleIdentifier.data()+12, "py_inline" , 9) != 0) |
| 135 | break; |
| 136 | return 12; // "combine_memcpy_inline" |
| 137 | case 's': // 1 string to match. |
| 138 | if (memcmp(RuleIdentifier.data()+12, "et_inline" , 9) != 0) |
| 139 | break; |
| 140 | return 13; // "combine_memset_inline" |
| 141 | } |
| 142 | break; |
| 143 | } |
| 144 | break; |
| 145 | case 22: // 1 string to match. |
| 146 | if (memcmp(RuleIdentifier.data()+0, "combine_shuffle_vector" , 22) != 0) |
| 147 | break; |
| 148 | return 11; // "combine_shuffle_vector" |
| 149 | } |
| 150 | #endif // ifndef NDEBUG |
| 151 | |
| 152 | return std::nullopt; |
| 153 | } |
| 154 | static std::optional<std::pair<uint64_t, uint64_t>> getRuleRangeForIdentifier(StringRef RuleIdentifier) { |
| 155 | std::pair<StringRef, StringRef> RangePair = RuleIdentifier.split('-'); |
| 156 | if (!RangePair.second.empty()) { |
| 157 | const auto First = getRuleIdxForIdentifier(RangePair.first); |
| 158 | const auto Last = getRuleIdxForIdentifier(RangePair.second); |
| 159 | if (!First || !Last) |
| 160 | return std::nullopt; |
| 161 | if (First >= Last) |
| 162 | report_fatal_error("Beginning of range should be before end of range" ); |
| 163 | return {{*First, *Last + 1}}; |
| 164 | } |
| 165 | if (RangePair.first == "*" ) { |
| 166 | return {{0, 18}}; |
| 167 | } |
| 168 | const auto I = getRuleIdxForIdentifier(RangePair.first); |
| 169 | if (!I) |
| 170 | return std::nullopt; |
| 171 | return {{*I, *I + 1}}; |
| 172 | } |
| 173 | |
| 174 | bool AArch64O0PreLegalizerCombinerImplRuleConfig::setRuleEnabled(StringRef RuleIdentifier) { |
| 175 | auto MaybeRange = getRuleRangeForIdentifier(RuleIdentifier); |
| 176 | if (!MaybeRange) |
| 177 | return false; |
| 178 | for (auto I = MaybeRange->first; I < MaybeRange->second; ++I) |
| 179 | DisabledRules.reset(I); |
| 180 | return true; |
| 181 | } |
| 182 | |
| 183 | bool AArch64O0PreLegalizerCombinerImplRuleConfig::setRuleDisabled(StringRef RuleIdentifier) { |
| 184 | auto MaybeRange = getRuleRangeForIdentifier(RuleIdentifier); |
| 185 | if (!MaybeRange) |
| 186 | return false; |
| 187 | for (auto I = MaybeRange->first; I < MaybeRange->second; ++I) |
| 188 | DisabledRules.set(I); |
| 189 | return true; |
| 190 | } |
| 191 | |
| 192 | static std::vector<std::string> AArch64O0PreLegalizerCombinerOption; |
| 193 | static cl::list<std::string> AArch64O0PreLegalizerCombinerDisableOption( |
| 194 | "aarch64o0prelegalizercombiner-disable-rule" , |
| 195 | cl::desc("Disable one or more combiner rules temporarily in the AArch64O0PreLegalizerCombiner pass" ), |
| 196 | cl::CommaSeparated, |
| 197 | cl::Hidden, |
| 198 | cl::cat(GICombinerOptionCategory), |
| 199 | cl::callback([](const std::string &Str) { |
| 200 | AArch64O0PreLegalizerCombinerOption.push_back(Str); |
| 201 | })); |
| 202 | static cl::list<std::string> AArch64O0PreLegalizerCombinerOnlyEnableOption( |
| 203 | "aarch64o0prelegalizercombiner-only-enable-rule" , |
| 204 | cl::desc("Disable all rules in the AArch64O0PreLegalizerCombiner pass then re-enable the specified ones" ), |
| 205 | cl::Hidden, |
| 206 | cl::cat(GICombinerOptionCategory), |
| 207 | cl::callback([](const std::string &CommaSeparatedArg) { |
| 208 | StringRef Str = CommaSeparatedArg; |
| 209 | AArch64O0PreLegalizerCombinerOption.push_back("*" ); |
| 210 | do { |
| 211 | auto X = Str.split("," ); |
| 212 | AArch64O0PreLegalizerCombinerOption.push_back(("!" + X.first).str()); |
| 213 | Str = X.second; |
| 214 | } while (!Str.empty()); |
| 215 | })); |
| 216 | |
| 217 | |
| 218 | bool AArch64O0PreLegalizerCombinerImplRuleConfig::isRuleEnabled(unsigned RuleID) const { |
| 219 | return !DisabledRules.test(RuleID); |
| 220 | } |
| 221 | bool AArch64O0PreLegalizerCombinerImplRuleConfig::parseCommandLineOption() { |
| 222 | for (StringRef Identifier : AArch64O0PreLegalizerCombinerOption) { |
| 223 | bool Enabled = Identifier.consume_front("!" ); |
| 224 | if (Enabled && !setRuleEnabled(Identifier)) |
| 225 | return false; |
| 226 | if (!Enabled && !setRuleDisabled(Identifier)) |
| 227 | return false; |
| 228 | } |
| 229 | return true; |
| 230 | } |
| 231 | |
| 232 | |
| 233 | #endif // GET_GICOMBINER_TYPES |
| 234 | |
| 235 | #ifdef GET_GICOMBINER_TYPES |
| 236 | |
| 237 | const unsigned MAX_SUBTARGET_PREDICATES = 0; |
| 238 | using PredicateBitset = llvm::Bitset<MAX_SUBTARGET_PREDICATES>; |
| 239 | |
| 240 | #endif // GET_GICOMBINER_TYPES |
| 241 | |
| 242 | #ifdef GET_GICOMBINER_CLASS_MEMBERS |
| 243 | |
| 244 | PredicateBitset AvailableModuleFeatures; |
| 245 | mutable PredicateBitset AvailableFunctionFeatures; |
| 246 | PredicateBitset getAvailableFeatures() const { |
| 247 | return AvailableModuleFeatures | AvailableFunctionFeatures; |
| 248 | } |
| 249 | PredicateBitset |
| 250 | computeAvailableModuleFeatures(const AArch64Subtarget *Subtarget) const; |
| 251 | PredicateBitset |
| 252 | computeAvailableFunctionFeatures(const AArch64Subtarget *Subtarget, |
| 253 | const MachineFunction *MF) const; |
| 254 | void setupGeneratedPerFunctionState(MachineFunction &MF) override; |
| 255 | |
| 256 | #endif // GET_GICOMBINER_CLASS_MEMBERS |
| 257 | |
| 258 | #ifdef GET_GICOMBINER_CLASS_MEMBERS |
| 259 | |
| 260 | mutable MatcherState State; |
| 261 | typedef ComplexRendererFns(AArch64O0PreLegalizerCombinerImpl::*ComplexMatcherMemFn)(MachineOperand &) const; |
| 262 | typedef void(AArch64O0PreLegalizerCombinerImpl::*CustomRendererFn)(MachineInstrBuilder &, const MachineInstr &, int) const; |
| 263 | const ExecInfoTy<PredicateBitset, ComplexMatcherMemFn, CustomRendererFn> ExecInfo; |
| 264 | static AArch64O0PreLegalizerCombinerImpl::ComplexMatcherMemFn ComplexPredicateFns[]; |
| 265 | static AArch64O0PreLegalizerCombinerImpl::CustomRendererFn CustomRenderers[]; |
| 266 | bool testImmPredicate_I64(unsigned PredicateID, int64_t Imm) const override; |
| 267 | bool testImmPredicate_APInt(unsigned PredicateID, const APInt &Imm) const override; |
| 268 | bool testImmPredicate_APFloat(unsigned PredicateID, const APFloat &Imm) const override; |
| 269 | const uint8_t *getMatchTable() const override; |
| 270 | bool testMIPredicate_MI(unsigned PredicateID, const MachineInstr &MI, const MatcherState &State) const override; |
| 271 | bool testMOPredicate_MO(unsigned PredicateID, const MachineOperand &MO, const MatcherState &State) const override; |
| 272 | bool testSimplePredicate(unsigned PredicateID) const override; |
| 273 | bool runCustomAction(unsigned FnID, const MatcherState &State, NewMIVector &OutMIs) const override; |
| 274 | |
| 275 | #endif // GET_GICOMBINER_CLASS_MEMBERS |
| 276 | |
| 277 | #ifdef GET_GICOMBINER_IMPL |
| 278 | |
| 279 | // LLT Objects. |
| 280 | enum { |
| 281 | GILLT_s1, |
| 282 | }; |
| 283 | const static size_t NumTypeObjects = 1; |
| 284 | const static LLT TypeObjects[] = { |
| 285 | LLT::scalar(1), |
| 286 | }; |
| 287 | |
| 288 | // Bits for subtarget features that participate in instruction matching. |
| 289 | enum SubtargetFeatureBits : uint8_t { |
| 290 | }; |
| 291 | |
| 292 | PredicateBitset AArch64O0PreLegalizerCombinerImpl:: |
| 293 | computeAvailableModuleFeatures(const AArch64Subtarget *Subtarget) const { |
| 294 | PredicateBitset Features{}; |
| 295 | return Features; |
| 296 | } |
| 297 | |
| 298 | void AArch64O0PreLegalizerCombinerImpl::setupGeneratedPerFunctionState(MachineFunction &MF) { |
| 299 | AvailableFunctionFeatures = computeAvailableFunctionFeatures((const AArch64Subtarget *)&MF.getSubtarget(), &MF); |
| 300 | } |
| 301 | PredicateBitset AArch64O0PreLegalizerCombinerImpl:: |
| 302 | computeAvailableFunctionFeatures(const AArch64Subtarget *Subtarget, const MachineFunction *MF) const { |
| 303 | PredicateBitset Features{}; |
| 304 | return Features; |
| 305 | } |
| 306 | |
| 307 | // Feature bitsets. |
| 308 | enum { |
| 309 | GIFBS_Invalid, |
| 310 | }; |
| 311 | constexpr static PredicateBitset FeatureBitsets[] { |
| 312 | {}, // GIFBS_Invalid |
| 313 | }; |
| 314 | |
| 315 | // ComplexPattern predicates. |
| 316 | enum { |
| 317 | GICP_Invalid, |
| 318 | }; |
| 319 | // See constructor for table contents |
| 320 | |
| 321 | AArch64O0PreLegalizerCombinerImpl::ComplexMatcherMemFn |
| 322 | AArch64O0PreLegalizerCombinerImpl::ComplexPredicateFns[] = { |
| 323 | nullptr, // GICP_Invalid |
| 324 | }; |
| 325 | |
| 326 | bool AArch64O0PreLegalizerCombinerImpl::testMIPredicate_MI(unsigned PredicateID, const MachineInstr & MI, const MatcherState &State) const { |
| 327 | llvm_unreachable("Unknown predicate" ); |
| 328 | return false; |
| 329 | } |
| 330 | bool AArch64O0PreLegalizerCombinerImpl::testMOPredicate_MO(unsigned PredicateID, const MachineOperand & MO, const MatcherState &State) const { |
| 331 | llvm_unreachable("Unknown predicate" ); |
| 332 | return false; |
| 333 | } |
| 334 | bool AArch64O0PreLegalizerCombinerImpl::testImmPredicate_I64(unsigned PredicateID, int64_t Imm) const { |
| 335 | llvm_unreachable("Unknown predicate" ); |
| 336 | return false; |
| 337 | } |
| 338 | bool AArch64O0PreLegalizerCombinerImpl::testImmPredicate_APFloat(unsigned PredicateID, const APFloat & Imm) const { |
| 339 | llvm_unreachable("Unknown predicate" ); |
| 340 | return false; |
| 341 | } |
| 342 | bool AArch64O0PreLegalizerCombinerImpl::testImmPredicate_APInt(unsigned PredicateID, const APInt & Imm) const { |
| 343 | llvm_unreachable("Unknown predicate" ); |
| 344 | return false; |
| 345 | } |
| 346 | enum { |
| 347 | GICXXPred_Simple_IsRule0Enabled = GICXXPred_Invalid + 1, |
| 348 | GICXXPred_Simple_IsRule1Enabled, |
| 349 | GICXXPred_Simple_IsRule2Enabled, |
| 350 | GICXXPred_Simple_IsRule3Enabled, |
| 351 | GICXXPred_Simple_IsRule4Enabled, |
| 352 | GICXXPred_Simple_IsRule5Enabled, |
| 353 | GICXXPred_Simple_IsRule6Enabled, |
| 354 | GICXXPred_Simple_IsRule7Enabled, |
| 355 | GICXXPred_Simple_IsRule8Enabled, |
| 356 | GICXXPred_Simple_IsRule9Enabled, |
| 357 | GICXXPred_Simple_IsRule10Enabled, |
| 358 | GICXXPred_Simple_IsRule11Enabled, |
| 359 | GICXXPred_Simple_IsRule12Enabled, |
| 360 | GICXXPred_Simple_IsRule13Enabled, |
| 361 | GICXXPred_Simple_IsRule14Enabled, |
| 362 | GICXXPred_Simple_IsRule15Enabled, |
| 363 | GICXXPred_Simple_IsRule16Enabled, |
| 364 | GICXXPred_Simple_IsRule17Enabled, |
| 365 | }; |
| 366 | |
| 367 | bool AArch64O0PreLegalizerCombinerImpl::testSimplePredicate(unsigned Predicate) const { |
| 368 | return RuleConfig.isRuleEnabled(Predicate - GICXXPred_Invalid - 1); |
| 369 | } |
| 370 | // Custom renderers. |
| 371 | enum { |
| 372 | GICR_Invalid, |
| 373 | }; |
| 374 | AArch64O0PreLegalizerCombinerImpl::CustomRendererFn |
| 375 | AArch64O0PreLegalizerCombinerImpl::CustomRenderers[] = { |
| 376 | nullptr, // GICR_Invalid |
| 377 | }; |
| 378 | |
| 379 | static bool AArch64O0PreLegalizerCombinerImpl_canMatchOpcode(unsigned Opc) { |
| 380 | switch (Opc) { |
| 381 | case TargetOpcode::G_MEMCPY: |
| 382 | case TargetOpcode::G_MEMMOVE: |
| 383 | case TargetOpcode::G_MEMSET: |
| 384 | case TargetOpcode::G_MEMCPY_INLINE: |
| 385 | case TargetOpcode::G_MEMSET_INLINE: |
| 386 | case TargetOpcode::G_MUL: |
| 387 | case TargetOpcode::G_SUB: |
| 388 | case TargetOpcode::COPY: |
| 389 | case TargetOpcode::G_FABS: |
| 390 | case TargetOpcode::G_FCANONICALIZE: |
| 391 | case TargetOpcode::G_FREEZE: |
| 392 | case TargetOpcode::G_ADD: |
| 393 | case TargetOpcode::G_AND: |
| 394 | case TargetOpcode::G_CONCAT_VECTORS: |
| 395 | case TargetOpcode::G_LOAD: |
| 396 | case TargetOpcode::G_PTR_ADD: |
| 397 | case TargetOpcode::G_SEXTLOAD: |
| 398 | case TargetOpcode::G_SHUFFLE_VECTOR: |
| 399 | case TargetOpcode::G_XOR: |
| 400 | case TargetOpcode::G_ZEXTLOAD: |
| 401 | return true; |
| 402 | default: |
| 403 | return false; |
| 404 | } |
| 405 | } |
| 406 | |
| 407 | bool AArch64O0PreLegalizerCombinerImpl::tryCombineAllImpl(MachineInstr &I) const { |
| 408 | if (!AArch64O0PreLegalizerCombinerImpl_canMatchOpcode(I.getOpcode())) |
| 409 | return false; |
| 410 | const PredicateBitset AvailableFeatures = getAvailableFeatures(); |
| 411 | State.MIs.clear(); |
| 412 | State.MIs.push_back(&I); |
| 413 | if (executeMatchTable(*this, State, ExecInfo, B, getMatchTable(), Helper.getTII(), MRI, Helper.getTRI(), Helper.getRBI(), AvailableFeatures, /*CoverageInfo*/ nullptr)) { |
| 414 | return true; |
| 415 | } |
| 416 | |
| 417 | return false; |
| 418 | } |
| 419 | |
| 420 | enum { |
| 421 | GICXXCustomAction_GICombiner0 = GICXXCustomAction_Invalid + 1, |
| 422 | GICXXCustomAction_GICombiner1, |
| 423 | GICXXCustomAction_GICombiner2, |
| 424 | GICXXCustomAction_GICombiner3, |
| 425 | GICXXCustomAction_GICombiner4, |
| 426 | GICXXCustomAction_GICombiner5, |
| 427 | GICXXCustomAction_GICombiner6, |
| 428 | GICXXCustomAction_GICombiner7, |
| 429 | GICXXCustomAction_GICombiner8, |
| 430 | GICXXCustomAction_GICombiner9, |
| 431 | GICXXCustomAction_GICombiner10, |
| 432 | GICXXCustomAction_GICombiner11, |
| 433 | GICXXCustomAction_GICombiner12, |
| 434 | }; |
| 435 | bool AArch64O0PreLegalizerCombinerImpl::runCustomAction(unsigned ApplyID, const MatcherState &State, NewMIVector &OutMIs) const { |
| 436 | Helper.getBuilder().setInstrAndDebugLoc(*State.MIs[0]); |
| 437 | switch(ApplyID) { |
| 438 | case GICXXCustomAction_GICombiner0:{ |
| 439 | // Match Patterns |
| 440 | if(![&](){return Helper.matchCombineCopy(*State.MIs[0]);}()) { |
| 441 | return false; |
| 442 | } |
| 443 | // Apply Patterns |
| 444 | Helper.applyCombineCopy(*State.MIs[0]); |
| 445 | return true; |
| 446 | } |
| 447 | case GICXXCustomAction_GICombiner1:{ |
| 448 | unsigned GIMatchData_matchinfo; |
| 449 | // Match Patterns |
| 450 | if(![&](){return Helper.matchCombineMulToShl(*State.MIs[0], GIMatchData_matchinfo);}()) { |
| 451 | return false; |
| 452 | } |
| 453 | // Apply Patterns |
| 454 | Helper.applyCombineMulToShl(*State.MIs[0], GIMatchData_matchinfo); |
| 455 | return true; |
| 456 | } |
| 457 | case GICXXCustomAction_GICombiner2:{ |
| 458 | std::function<void(MachineIRBuilder &)> GIMatchData_matchinfo; |
| 459 | // Match Patterns |
| 460 | if(![&](){return Helper.matchCombineSubToAdd(*State.MIs[0], GIMatchData_matchinfo);}()) { |
| 461 | return false; |
| 462 | } |
| 463 | // Apply Patterns |
| 464 | Helper.applyBuildFnNoErase(*State.MIs[0], GIMatchData_matchinfo); |
| 465 | return true; |
| 466 | } |
| 467 | case GICXXCustomAction_GICombiner3:{ |
| 468 | std::pair<Register, bool> GIMatchData_info; |
| 469 | // Match Patterns |
| 470 | if(![&](){return Helper.matchCombineAddP2IToPtrAdd(*State.MIs[0], GIMatchData_info);}()) { |
| 471 | return false; |
| 472 | } |
| 473 | // Apply Patterns |
| 474 | Helper.applyCombineAddP2IToPtrAdd(*State.MIs[0], GIMatchData_info); |
| 475 | return true; |
| 476 | } |
| 477 | case GICXXCustomAction_GICombiner4:{ |
| 478 | PtrAddChain GIMatchData_matchinfo; |
| 479 | // Match Patterns |
| 480 | if(![&](){return Helper.matchPtrAddImmedChain(*State.MIs[0], GIMatchData_matchinfo);}()) { |
| 481 | return false; |
| 482 | } |
| 483 | // Apply Patterns |
| 484 | Helper.applyPtrAddImmedChain(*State.MIs[0], GIMatchData_matchinfo); |
| 485 | return true; |
| 486 | } |
| 487 | case GICXXCustomAction_GICombiner5:{ |
| 488 | PreferredTuple GIMatchData_matchinfo; |
| 489 | // Match Patterns |
| 490 | if(![&](){return Helper.matchCombineExtendingLoads(*State.MIs[0], GIMatchData_matchinfo);}()) { |
| 491 | return false; |
| 492 | } |
| 493 | // Apply Patterns |
| 494 | Helper.applyCombineExtendingLoads(*State.MIs[0], GIMatchData_matchinfo); |
| 495 | return true; |
| 496 | } |
| 497 | case GICXXCustomAction_GICombiner6:{ |
| 498 | std::function<void(MachineIRBuilder &)> GIMatchData_matchinfo; |
| 499 | // Match Patterns |
| 500 | if(![&](){return Helper.matchCombineLoadWithAndMask(*State.MIs[0], GIMatchData_matchinfo);}()) { |
| 501 | return false; |
| 502 | } |
| 503 | // Apply Patterns |
| 504 | Helper.applyBuildFn(*State.MIs[0], GIMatchData_matchinfo); |
| 505 | return true; |
| 506 | } |
| 507 | case GICXXCustomAction_GICombiner7:{ |
| 508 | SmallVector<Register> GIMatchData_info; |
| 509 | // Match Patterns |
| 510 | if(![&](){return Helper.matchNotCmp(*State.MIs[0], GIMatchData_info);}()) { |
| 511 | return false; |
| 512 | } |
| 513 | // Apply Patterns |
| 514 | Helper.applyNotCmp(*State.MIs[0], GIMatchData_info); |
| 515 | return true; |
| 516 | } |
| 517 | case GICXXCustomAction_GICombiner8:{ |
| 518 | SmallVector<Register> GIMatchData_matchinfo; |
| 519 | // Match Patterns |
| 520 | if(![&](){return Helper.matchCombineConcatVectors(*State.MIs[0], GIMatchData_matchinfo);}()) { |
| 521 | return false; |
| 522 | } |
| 523 | // Apply Patterns |
| 524 | Helper.applyCombineConcatVectors(*State.MIs[0], GIMatchData_matchinfo); |
| 525 | return true; |
| 526 | } |
| 527 | case GICXXCustomAction_GICombiner9:{ |
| 528 | SmallVector<Register> GIMatchData_matchinfo; |
| 529 | // Match Patterns |
| 530 | if(![&](){return Helper.matchCombineShuffleVector(*State.MIs[0], GIMatchData_matchinfo);}()) { |
| 531 | return false; |
| 532 | } |
| 533 | // Apply Patterns |
| 534 | Helper.applyCombineShuffleVector(*State.MIs[0], GIMatchData_matchinfo); |
| 535 | return true; |
| 536 | } |
| 537 | case GICXXCustomAction_GICombiner10:{ |
| 538 | MemCpyFamilyLoweringInfo GIMatchData_matchinfo; |
| 539 | // Match Patterns |
| 540 | if(![&](){return Helper.matchCombineMemCpyFamily(*State.MIs[0], GIMatchData_matchinfo);}()) { |
| 541 | return false; |
| 542 | } |
| 543 | // Apply Patterns |
| 544 | Helper.applyCombineMemCpyFamily(*State.MIs[0], GIMatchData_matchinfo); |
| 545 | return true; |
| 546 | } |
| 547 | case GICXXCustomAction_GICombiner11:{ |
| 548 | MemCpyFamilyLoweringInfo GIMatchData_matchinfo; |
| 549 | // Match Patterns |
| 550 | if(![&](){return Helper.matchCombineMemCpyFamily(*State.MIs[0], GIMatchData_matchinfo, |
| 551 | CInfo.EnableOpt ? 0 : 32);}()) { |
| 552 | return false; |
| 553 | } |
| 554 | // Apply Patterns |
| 555 | Helper.applyCombineMemCpyFamily(*State.MIs[0], GIMatchData_matchinfo); |
| 556 | return true; |
| 557 | } |
| 558 | case GICXXCustomAction_GICombiner12:{ |
| 559 | // Match Patterns |
| 560 | if(![&](){return llvm::AArch64GISelUtils::matchEmitBZero(*State.MIs[0], MRI, |
| 561 | Libcalls, |
| 562 | CInfo.EnableMinSize);}()) { |
| 563 | return false; |
| 564 | } |
| 565 | // Apply Patterns |
| 566 | llvm::AArch64GISelUtils::applyEmitBZero(*State.MIs[0], B); |
| 567 | return true; |
| 568 | } |
| 569 | } |
| 570 | llvm_unreachable("Unknown Apply Action" ); |
| 571 | } |
| 572 | #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ |
| 573 | #define GIMT_Encode2(Val) uint8_t(Val), uint8_t((Val) >> 8) |
| 574 | #define GIMT_Encode4(Val) uint8_t(Val), uint8_t((Val) >> 8), uint8_t((Val) >> 16), uint8_t((Val) >> 24) |
| 575 | #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) |
| 576 | #else |
| 577 | #define GIMT_Encode2(Val) uint8_t((Val) >> 8), uint8_t(Val) |
| 578 | #define GIMT_Encode4(Val) uint8_t((Val) >> 24), uint8_t((Val) >> 16), uint8_t((Val) >> 8), uint8_t(Val) |
| 579 | #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) |
| 580 | #endif |
| 581 | const uint8_t *AArch64O0PreLegalizerCombinerImpl::getMatchTable() const { |
| 582 | constexpr static uint8_t MatchTable0[] = { |
| 583 | /* 0 */ GIM_SwitchOpcode, /*MI*/0, /*[*/GIMT_Encode2(20), GIMT_Encode2(309), /*)*//*default:*//*Label 20*/ GIMT_Encode4(1521), |
| 584 | /* 10 */ /*TargetOpcode::COPY*//*Label 0*/ GIMT_Encode4(1166), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), |
| 585 | /* 150 */ /*TargetOpcode::G_ADD*//*Label 1*/ GIMT_Encode4(1178), |
| 586 | /* 154 */ /*TargetOpcode::G_SUB*//*Label 2*/ GIMT_Encode4(1190), |
| 587 | /* 158 */ /*TargetOpcode::G_MUL*//*Label 3*/ GIMT_Encode4(1212), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), |
| 588 | /* 186 */ /*TargetOpcode::G_AND*//*Label 4*/ GIMT_Encode4(1264), GIMT_Encode4(0), |
| 589 | /* 194 */ /*TargetOpcode::G_XOR*//*Label 5*/ GIMT_Encode4(1276), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), |
| 590 | /* 270 */ /*TargetOpcode::G_CONCAT_VECTORS*//*Label 6*/ GIMT_Encode4(1288), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), |
| 591 | /* 286 */ /*TargetOpcode::G_FREEZE*//*Label 7*/ GIMT_Encode4(1300), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), |
| 592 | /* 326 */ /*TargetOpcode::G_LOAD*//*Label 8*/ GIMT_Encode4(1330), |
| 593 | /* 330 */ /*TargetOpcode::G_SEXTLOAD*//*Label 9*/ GIMT_Encode4(1342), |
| 594 | /* 334 */ /*TargetOpcode::G_ZEXTLOAD*//*Label 10*/ GIMT_Encode4(1354), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), |
| 595 | /* 810 */ /*TargetOpcode::G_FABS*//*Label 11*/ GIMT_Encode4(1366), GIMT_Encode4(0), GIMT_Encode4(0), |
| 596 | /* 822 */ /*TargetOpcode::G_FCANONICALIZE*//*Label 12*/ GIMT_Encode4(1396), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), |
| 597 | /* 890 */ /*TargetOpcode::G_PTR_ADD*//*Label 13*/ GIMT_Encode4(1426), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), |
| 598 | /* 954 */ /*TargetOpcode::G_SHUFFLE_VECTOR*//*Label 14*/ GIMT_Encode4(1438), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), |
| 599 | /* 1142 */ /*TargetOpcode::G_MEMCPY*//*Label 15*/ GIMT_Encode4(1450), |
| 600 | /* 1146 */ /*TargetOpcode::G_MEMCPY_INLINE*//*Label 16*/ GIMT_Encode4(1462), |
| 601 | /* 1150 */ /*TargetOpcode::G_MEMMOVE*//*Label 17*/ GIMT_Encode4(1474), |
| 602 | /* 1154 */ /*TargetOpcode::G_MEMSET*//*Label 18*/ GIMT_Encode4(1486), GIMT_Encode4(0), |
| 603 | /* 1162 */ /*TargetOpcode::G_MEMSET_INLINE*//*Label 19*/ GIMT_Encode4(1509), |
| 604 | /* 1166 */ // Label 0: @1166 |
| 605 | /* 1166 */ GIM_Try, /*On fail goto*//*Label 21*/ GIMT_Encode4(1177), // Rule ID 0 // |
| 606 | /* 1171 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule0Enabled), |
| 607 | /* 1174 */ // MIs[0] d |
| 608 | /* 1174 */ // No operand predicates |
| 609 | /* 1174 */ // MIs[0] s |
| 610 | /* 1174 */ // No operand predicates |
| 611 | /* 1174 */ // Combiner Rule #0: copy_prop |
| 612 | /* 1174 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner0), |
| 613 | /* 1177 */ // Label 21: @1177 |
| 614 | /* 1177 */ GIM_Reject, |
| 615 | /* 1178 */ // Label 1: @1178 |
| 616 | /* 1178 */ GIM_Try, /*On fail goto*//*Label 22*/ GIMT_Encode4(1189), // Rule ID 3 // |
| 617 | /* 1183 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule3Enabled), |
| 618 | /* 1186 */ // Combiner Rule #3: add_p2i_to_ptradd; wip_match_opcode 'G_ADD' |
| 619 | /* 1186 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner3), |
| 620 | /* 1189 */ // Label 22: @1189 |
| 621 | /* 1189 */ GIM_Reject, |
| 622 | /* 1190 */ // Label 2: @1190 |
| 623 | /* 1190 */ GIM_Try, /*On fail goto*//*Label 23*/ GIMT_Encode4(1211), // Rule ID 2 // |
| 624 | /* 1195 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule2Enabled), |
| 625 | /* 1198 */ // MIs[0] d |
| 626 | /* 1198 */ // No operand predicates |
| 627 | /* 1198 */ // MIs[0] op1 |
| 628 | /* 1198 */ // No operand predicates |
| 629 | /* 1198 */ // MIs[0] c |
| 630 | /* 1198 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1] |
| 631 | /* 1202 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_CONSTANT), |
| 632 | /* 1206 */ // MIs[1] imm |
| 633 | /* 1206 */ // No operand predicates |
| 634 | /* 1206 */ GIM_CheckIsSafeToFold, /*NumInsns*/1, |
| 635 | /* 1208 */ // Combiner Rule #2: sub_to_add |
| 636 | /* 1208 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner2), |
| 637 | /* 1211 */ // Label 23: @1211 |
| 638 | /* 1211 */ GIM_Reject, |
| 639 | /* 1212 */ // Label 3: @1212 |
| 640 | /* 1212 */ GIM_Try, /*On fail goto*//*Label 24*/ GIMT_Encode4(1252), // Rule ID 4 // |
| 641 | /* 1217 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule4Enabled), |
| 642 | /* 1220 */ // MIs[0] dst |
| 643 | /* 1220 */ GIM_RecordRegType, /*MI*/0, /*Op*/0, /*TempTypeIdx*/255, |
| 644 | /* 1224 */ // MIs[0] x |
| 645 | /* 1224 */ // No operand predicates |
| 646 | /* 1224 */ // MIs[0] Operand 2 |
| 647 | /* 1224 */ GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 255, |
| 648 | /* 1228 */ GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/255, |
| 649 | /* 1231 */ GIR_BuildConstant, /*TempRegID*/0, /*Val*/GIMT_Encode8(0), |
| 650 | /* 1241 */ // Combiner Rule #4: mul_by_neg_one |
| 651 | /* 1241 */ GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(TargetOpcode::G_SUB), |
| 652 | /* 1244 */ GIR_RootToRootCopy, /*OpIdx*/0, // dst |
| 653 | /* 1246 */ GIR_AddSimpleTempRegister, /*InsnID*/0, /*TempRegID*/0, |
| 654 | /* 1249 */ GIR_RootToRootCopy, /*OpIdx*/1, // x |
| 655 | /* 1251 */ GIR_EraseRootFromParent_Done, |
| 656 | /* 1252 */ // Label 24: @1252 |
| 657 | /* 1252 */ GIM_Try, /*On fail goto*//*Label 25*/ GIMT_Encode4(1263), // Rule ID 1 // |
| 658 | /* 1257 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule1Enabled), |
| 659 | /* 1260 */ // MIs[0] d |
| 660 | /* 1260 */ // No operand predicates |
| 661 | /* 1260 */ // MIs[0] op1 |
| 662 | /* 1260 */ // No operand predicates |
| 663 | /* 1260 */ // MIs[0] op2 |
| 664 | /* 1260 */ // No operand predicates |
| 665 | /* 1260 */ // Combiner Rule #1: mul_to_shl |
| 666 | /* 1260 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner1), |
| 667 | /* 1263 */ // Label 25: @1263 |
| 668 | /* 1263 */ GIM_Reject, |
| 669 | /* 1264 */ // Label 4: @1264 |
| 670 | /* 1264 */ GIM_Try, /*On fail goto*//*Label 26*/ GIMT_Encode4(1275), // Rule ID 12 // |
| 671 | /* 1269 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule8Enabled), |
| 672 | /* 1272 */ // Combiner Rule #8: load_and_mask; wip_match_opcode 'G_AND' |
| 673 | /* 1272 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner6), |
| 674 | /* 1275 */ // Label 26: @1275 |
| 675 | /* 1275 */ GIM_Reject, |
| 676 | /* 1276 */ // Label 5: @1276 |
| 677 | /* 1276 */ GIM_Try, /*On fail goto*//*Label 27*/ GIMT_Encode4(1287), // Rule ID 13 // |
| 678 | /* 1281 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule9Enabled), |
| 679 | /* 1284 */ // Combiner Rule #9: not_cmp_fold; wip_match_opcode 'G_XOR' |
| 680 | /* 1284 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner7), |
| 681 | /* 1287 */ // Label 27: @1287 |
| 682 | /* 1287 */ GIM_Reject, |
| 683 | /* 1288 */ // Label 6: @1288 |
| 684 | /* 1288 */ GIM_Try, /*On fail goto*//*Label 28*/ GIMT_Encode4(1299), // Rule ID 14 // |
| 685 | /* 1293 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule10Enabled), |
| 686 | /* 1296 */ // Combiner Rule #10: combine_concat_vector; wip_match_opcode 'G_CONCAT_VECTORS' |
| 687 | /* 1296 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner8), |
| 688 | /* 1299 */ // Label 28: @1299 |
| 689 | /* 1299 */ GIM_Reject, |
| 690 | /* 1300 */ // Label 7: @1300 |
| 691 | /* 1300 */ GIM_Try, /*On fail goto*//*Label 29*/ GIMT_Encode4(1329), // Rule ID 5 // |
| 692 | /* 1305 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule5Enabled), |
| 693 | /* 1308 */ // MIs[0] dst |
| 694 | /* 1308 */ // No operand predicates |
| 695 | /* 1308 */ // MIs[0] src |
| 696 | /* 1308 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1] |
| 697 | /* 1312 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_FREEZE), |
| 698 | /* 1316 */ // MIs[1] __idempotent_prop_match_0.x |
| 699 | /* 1316 */ // No operand predicates |
| 700 | /* 1316 */ GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1, |
| 701 | /* 1321 */ GIM_CheckIsSafeToFold, /*NumInsns*/1, |
| 702 | /* 1323 */ // Combiner Rule #5: idempotent_prop @ [__idempotent_prop_match_0[0]] |
| 703 | /* 1323 */ GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1, |
| 704 | /* 1328 */ GIR_EraseRootFromParent_Done, |
| 705 | /* 1329 */ // Label 29: @1329 |
| 706 | /* 1329 */ GIM_Reject, |
| 707 | /* 1330 */ // Label 8: @1330 |
| 708 | /* 1330 */ GIM_Try, /*On fail goto*//*Label 30*/ GIMT_Encode4(1341), // Rule ID 9 // |
| 709 | /* 1335 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule7Enabled), |
| 710 | /* 1338 */ // Combiner Rule #7: extending_loads; wip_match_opcode 'G_LOAD' |
| 711 | /* 1338 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner5), |
| 712 | /* 1341 */ // Label 30: @1341 |
| 713 | /* 1341 */ GIM_Reject, |
| 714 | /* 1342 */ // Label 9: @1342 |
| 715 | /* 1342 */ GIM_Try, /*On fail goto*//*Label 31*/ GIMT_Encode4(1353), // Rule ID 10 // |
| 716 | /* 1347 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule7Enabled), |
| 717 | /* 1350 */ // Combiner Rule #7: extending_loads; wip_match_opcode 'G_SEXTLOAD' |
| 718 | /* 1350 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner5), |
| 719 | /* 1353 */ // Label 31: @1353 |
| 720 | /* 1353 */ GIM_Reject, |
| 721 | /* 1354 */ // Label 10: @1354 |
| 722 | /* 1354 */ GIM_Try, /*On fail goto*//*Label 32*/ GIMT_Encode4(1365), // Rule ID 11 // |
| 723 | /* 1359 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule7Enabled), |
| 724 | /* 1362 */ // Combiner Rule #7: extending_loads; wip_match_opcode 'G_ZEXTLOAD' |
| 725 | /* 1362 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner5), |
| 726 | /* 1365 */ // Label 32: @1365 |
| 727 | /* 1365 */ GIM_Reject, |
| 728 | /* 1366 */ // Label 11: @1366 |
| 729 | /* 1366 */ GIM_Try, /*On fail goto*//*Label 33*/ GIMT_Encode4(1395), // Rule ID 6 // |
| 730 | /* 1371 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule5Enabled), |
| 731 | /* 1374 */ // MIs[0] dst |
| 732 | /* 1374 */ // No operand predicates |
| 733 | /* 1374 */ // MIs[0] src |
| 734 | /* 1374 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1] |
| 735 | /* 1378 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_FABS), |
| 736 | /* 1382 */ // MIs[1] __idempotent_prop_match_0.x |
| 737 | /* 1382 */ // No operand predicates |
| 738 | /* 1382 */ GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1, |
| 739 | /* 1387 */ GIM_CheckIsSafeToFold, /*NumInsns*/1, |
| 740 | /* 1389 */ // Combiner Rule #5: idempotent_prop @ [__idempotent_prop_match_0[1]] |
| 741 | /* 1389 */ GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1, |
| 742 | /* 1394 */ GIR_EraseRootFromParent_Done, |
| 743 | /* 1395 */ // Label 33: @1395 |
| 744 | /* 1395 */ GIM_Reject, |
| 745 | /* 1396 */ // Label 12: @1396 |
| 746 | /* 1396 */ GIM_Try, /*On fail goto*//*Label 34*/ GIMT_Encode4(1425), // Rule ID 7 // |
| 747 | /* 1401 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule5Enabled), |
| 748 | /* 1404 */ // MIs[0] dst |
| 749 | /* 1404 */ // No operand predicates |
| 750 | /* 1404 */ // MIs[0] src |
| 751 | /* 1404 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1] |
| 752 | /* 1408 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_FCANONICALIZE), |
| 753 | /* 1412 */ // MIs[1] __idempotent_prop_match_0.x |
| 754 | /* 1412 */ // No operand predicates |
| 755 | /* 1412 */ GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1, |
| 756 | /* 1417 */ GIM_CheckIsSafeToFold, /*NumInsns*/1, |
| 757 | /* 1419 */ // Combiner Rule #5: idempotent_prop @ [__idempotent_prop_match_0[2]] |
| 758 | /* 1419 */ GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1, |
| 759 | /* 1424 */ GIR_EraseRootFromParent_Done, |
| 760 | /* 1425 */ // Label 34: @1425 |
| 761 | /* 1425 */ GIM_Reject, |
| 762 | /* 1426 */ // Label 13: @1426 |
| 763 | /* 1426 */ GIM_Try, /*On fail goto*//*Label 35*/ GIMT_Encode4(1437), // Rule ID 8 // |
| 764 | /* 1431 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule6Enabled), |
| 765 | /* 1434 */ // Combiner Rule #6: ptr_add_immed_chain; wip_match_opcode 'G_PTR_ADD' |
| 766 | /* 1434 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner4), |
| 767 | /* 1437 */ // Label 35: @1437 |
| 768 | /* 1437 */ GIM_Reject, |
| 769 | /* 1438 */ // Label 14: @1438 |
| 770 | /* 1438 */ GIM_Try, /*On fail goto*//*Label 36*/ GIMT_Encode4(1449), // Rule ID 15 // |
| 771 | /* 1443 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule11Enabled), |
| 772 | /* 1446 */ // Combiner Rule #11: combine_shuffle_vector; wip_match_opcode 'G_SHUFFLE_VECTOR' |
| 773 | /* 1446 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner9), |
| 774 | /* 1449 */ // Label 36: @1449 |
| 775 | /* 1449 */ GIM_Reject, |
| 776 | /* 1450 */ // Label 15: @1450 |
| 777 | /* 1450 */ GIM_Try, /*On fail goto*//*Label 37*/ GIMT_Encode4(1461), // Rule ID 18 // |
| 778 | /* 1455 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule14Enabled), |
| 779 | /* 1458 */ // MIs[0] dst_addr |
| 780 | /* 1458 */ // No operand predicates |
| 781 | /* 1458 */ // MIs[0] src_addr |
| 782 | /* 1458 */ // No operand predicates |
| 783 | /* 1458 */ // MIs[0] size |
| 784 | /* 1458 */ // No operand predicates |
| 785 | /* 1458 */ // MIs[0] tailcall |
| 786 | /* 1458 */ // No operand predicates |
| 787 | /* 1458 */ // Combiner Rule #14: combine_memcpy |
| 788 | /* 1458 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner11), |
| 789 | /* 1461 */ // Label 37: @1461 |
| 790 | /* 1461 */ GIM_Reject, |
| 791 | /* 1462 */ // Label 16: @1462 |
| 792 | /* 1462 */ GIM_Try, /*On fail goto*//*Label 38*/ GIMT_Encode4(1473), // Rule ID 16 // |
| 793 | /* 1467 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule12Enabled), |
| 794 | /* 1470 */ // MIs[0] dst_addr |
| 795 | /* 1470 */ // No operand predicates |
| 796 | /* 1470 */ // MIs[0] src_addr |
| 797 | /* 1470 */ // No operand predicates |
| 798 | /* 1470 */ // MIs[0] size |
| 799 | /* 1470 */ // No operand predicates |
| 800 | /* 1470 */ // Combiner Rule #12: combine_memcpy_inline |
| 801 | /* 1470 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner10), |
| 802 | /* 1473 */ // Label 38: @1473 |
| 803 | /* 1473 */ GIM_Reject, |
| 804 | /* 1474 */ // Label 17: @1474 |
| 805 | /* 1474 */ GIM_Try, /*On fail goto*//*Label 39*/ GIMT_Encode4(1485), // Rule ID 19 // |
| 806 | /* 1479 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule15Enabled), |
| 807 | /* 1482 */ // MIs[0] dst_addr |
| 808 | /* 1482 */ // No operand predicates |
| 809 | /* 1482 */ // MIs[0] src_addr |
| 810 | /* 1482 */ // No operand predicates |
| 811 | /* 1482 */ // MIs[0] size |
| 812 | /* 1482 */ // No operand predicates |
| 813 | /* 1482 */ // MIs[0] tailcall |
| 814 | /* 1482 */ // No operand predicates |
| 815 | /* 1482 */ // Combiner Rule #15: combine_memmove |
| 816 | /* 1482 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner11), |
| 817 | /* 1485 */ // Label 39: @1485 |
| 818 | /* 1485 */ GIM_Reject, |
| 819 | /* 1486 */ // Label 18: @1486 |
| 820 | /* 1486 */ GIM_Try, /*On fail goto*//*Label 40*/ GIMT_Encode4(1497), // Rule ID 20 // |
| 821 | /* 1491 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule16Enabled), |
| 822 | /* 1494 */ // MIs[0] dst_addr |
| 823 | /* 1494 */ // No operand predicates |
| 824 | /* 1494 */ // MIs[0] value |
| 825 | /* 1494 */ // No operand predicates |
| 826 | /* 1494 */ // MIs[0] size |
| 827 | /* 1494 */ // No operand predicates |
| 828 | /* 1494 */ // MIs[0] tailcall |
| 829 | /* 1494 */ // No operand predicates |
| 830 | /* 1494 */ // Combiner Rule #16: combine_memset |
| 831 | /* 1494 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner11), |
| 832 | /* 1497 */ // Label 40: @1497 |
| 833 | /* 1497 */ GIM_Try, /*On fail goto*//*Label 41*/ GIMT_Encode4(1508), // Rule ID 21 // |
| 834 | /* 1502 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule17Enabled), |
| 835 | /* 1505 */ // MIs[0] dst_addr |
| 836 | /* 1505 */ // No operand predicates |
| 837 | /* 1505 */ // MIs[0] value |
| 838 | /* 1505 */ // No operand predicates |
| 839 | /* 1505 */ // MIs[0] size |
| 840 | /* 1505 */ // No operand predicates |
| 841 | /* 1505 */ // MIs[0] tailcall |
| 842 | /* 1505 */ // No operand predicates |
| 843 | /* 1505 */ // Combiner Rule #17: emit_bzero |
| 844 | /* 1505 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner12), |
| 845 | /* 1508 */ // Label 41: @1508 |
| 846 | /* 1508 */ GIM_Reject, |
| 847 | /* 1509 */ // Label 19: @1509 |
| 848 | /* 1509 */ GIM_Try, /*On fail goto*//*Label 42*/ GIMT_Encode4(1520), // Rule ID 17 // |
| 849 | /* 1514 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule13Enabled), |
| 850 | /* 1517 */ // MIs[0] dst_addr |
| 851 | /* 1517 */ // No operand predicates |
| 852 | /* 1517 */ // MIs[0] value |
| 853 | /* 1517 */ // No operand predicates |
| 854 | /* 1517 */ // MIs[0] size |
| 855 | /* 1517 */ // No operand predicates |
| 856 | /* 1517 */ // Combiner Rule #13: combine_memset_inline |
| 857 | /* 1517 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner10), |
| 858 | /* 1520 */ // Label 42: @1520 |
| 859 | /* 1520 */ GIM_Reject, |
| 860 | /* 1521 */ // Label 20: @1521 |
| 861 | /* 1521 */ GIM_Reject, |
| 862 | /* 1522 */ }; // Size: 1522 bytes |
| 863 | return MatchTable0; |
| 864 | } |
| 865 | #undef GIMT_Encode2 |
| 866 | #undef GIMT_Encode4 |
| 867 | #undef GIMT_Encode8 |
| 868 | |
| 869 | |
| 870 | #endif // GET_GICOMBINER_IMPL |
| 871 | |
| 872 | #ifdef GET_GICOMBINER_CONSTRUCTOR_INITS |
| 873 | |
| 874 | AvailableModuleFeatures(computeAvailableModuleFeatures(&STI)), |
| 875 | AvailableFunctionFeatures() |
| 876 | |
| 877 | #endif // GET_GICOMBINER_CONSTRUCTOR_INITS |
| 878 | |
| 879 | #ifdef GET_GICOMBINER_CONSTRUCTOR_INITS |
| 880 | |
| 881 | , State(0), |
| 882 | ExecInfo(TypeObjects, NumTypeObjects, FeatureBitsets, ComplexPredicateFns, CustomRenderers) |
| 883 | |
| 884 | #endif // GET_GICOMBINER_CONSTRUCTOR_INITS |
| 885 | |
| 886 | |