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"
12namespace llvm {
13
14extern cl::OptionCategory GICombinerOptionCategory;
15
16} // namespace llvm
17
18#endif // GET_GICOMBINER_DEPS
19
20#ifdef GET_GICOMBINER_TYPES
21
22struct 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
31static 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}
154static 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
174bool 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
183bool 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
192static std::vector<std::string> AArch64O0PreLegalizerCombinerOption;
193static 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 }));
202static 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
218bool AArch64O0PreLegalizerCombinerImplRuleConfig::isRuleEnabled(unsigned RuleID) const {
219 return !DisabledRules.test(RuleID);
220}
221bool 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
237const unsigned MAX_SUBTARGET_PREDICATES = 0;
238using PredicateBitset = llvm::Bitset<MAX_SUBTARGET_PREDICATES>;
239
240#endif // GET_GICOMBINER_TYPES
241
242#ifdef GET_GICOMBINER_CLASS_MEMBERS
243
244 bool canMatchOpcode(unsigned Opc) const override;
245 uint32_t getRootFlagsToDrop() const override;
246
247#endif // GET_GICOMBINER_CLASS_MEMBERS
248
249#ifdef GET_GICOMBINER_CLASS_MEMBERS
250
251PredicateBitset AvailableModuleFeatures;
252mutable PredicateBitset AvailableFunctionFeatures;
253PredicateBitset getAvailableFeatures() const {
254 return AvailableModuleFeatures | AvailableFunctionFeatures;
255}
256PredicateBitset
257computeAvailableModuleFeatures(const AArch64Subtarget *Subtarget) const;
258PredicateBitset
259computeAvailableFunctionFeatures(const AArch64Subtarget *Subtarget,
260 const MachineFunction *MF) const;
261void setupGeneratedPerFunctionState(MachineFunction &MF) override;
262
263#endif // GET_GICOMBINER_CLASS_MEMBERS
264
265#ifdef GET_GICOMBINER_CLASS_MEMBERS
266
267 mutable MatcherState State;
268 typedef ComplexRendererFns(AArch64O0PreLegalizerCombinerImpl::*ComplexMatcherMemFn)(MachineOperand &) const;
269 typedef void(AArch64O0PreLegalizerCombinerImpl::*CustomRendererFn)(MachineInstrBuilder &, const MachineInstr &, int) const;
270 const ExecInfoTy<PredicateBitset, ComplexMatcherMemFn, CustomRendererFn> ExecInfo;
271 static AArch64O0PreLegalizerCombinerImpl::ComplexMatcherMemFn ComplexPredicateFns[];
272 static AArch64O0PreLegalizerCombinerImpl::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
282#endif // GET_GICOMBINER_CLASS_MEMBERS
283
284#ifdef GET_GICOMBINER_IMPL
285
286// LLT Objects.
287enum {
288 GILLT_s1,
289};
290const static size_t NumTypeObjects = 1;
291const static LLT TypeObjects[] = {
292 LLT::scalar(1),
293};
294
295// Bits for subtarget features that participate in instruction matching.
296enum SubtargetFeatureBits : uint8_t {
297};
298
299PredicateBitset AArch64O0PreLegalizerCombinerImpl::
300computeAvailableModuleFeatures(const AArch64Subtarget *Subtarget) const {
301 PredicateBitset Features{};
302 return Features;
303}
304
305void AArch64O0PreLegalizerCombinerImpl::setupGeneratedPerFunctionState(MachineFunction &MF) {
306 AvailableFunctionFeatures = computeAvailableFunctionFeatures((const AArch64Subtarget *)&MF.getSubtarget(), &MF);
307}
308PredicateBitset AArch64O0PreLegalizerCombinerImpl::
309computeAvailableFunctionFeatures(const AArch64Subtarget *Subtarget, const MachineFunction *MF) const {
310 PredicateBitset Features{};
311 return Features;
312}
313
314// Feature bitsets.
315enum {
316 GIFBS_Invalid,
317};
318constexpr static PredicateBitset FeatureBitsets[] {
319 {}, // GIFBS_Invalid
320};
321
322// ComplexPattern predicates.
323enum {
324 GICP_Invalid,
325};
326// See constructor for table contents
327
328AArch64O0PreLegalizerCombinerImpl::ComplexMatcherMemFn
329AArch64O0PreLegalizerCombinerImpl::ComplexPredicateFns[] = {
330 nullptr, // GICP_Invalid
331};
332
333enum {
334 GICXXPred_MI_Predicate_GICombiner0 = GICXXPred_Invalid + 1,
335};
336bool AArch64O0PreLegalizerCombinerImpl::testMIPredicate_MI(unsigned PredicateID, const MachineInstr & MI, const MatcherState &State) const {
337 switch (PredicateID) {
338 case GICXXPred_MI_Predicate_GICombiner0: {
339 return MRI.getType(State.MIs[1]->getOperand(1).getReg()).getScalarSizeInBits() ==
340 MRI.getType(State.MIs[0]->getOperand(0).getReg()).getScalarSizeInBits();
341 }
342 }
343 llvm_unreachable("Unknown predicate");
344 return false;
345}
346bool AArch64O0PreLegalizerCombinerImpl::testMOPredicate_MO(unsigned PredicateID, const MachineOperand & MO, const MatcherState &State) const {
347 llvm_unreachable("Unknown predicate");
348 return false;
349}
350bool AArch64O0PreLegalizerCombinerImpl::testImmPredicate_I64(unsigned PredicateID, int64_t Imm) const {
351 llvm_unreachable("Unknown predicate");
352 return false;
353}
354bool AArch64O0PreLegalizerCombinerImpl::testImmPredicate_APFloat(unsigned PredicateID, const APFloat & Imm) const {
355 llvm_unreachable("Unknown predicate");
356 return false;
357}
358bool AArch64O0PreLegalizerCombinerImpl::testImmPredicate_APInt(unsigned PredicateID, const APInt & Imm) const {
359 llvm_unreachable("Unknown predicate");
360 return false;
361}
362enum {
363 GICXXPred_Simple_IsRule0Enabled = GICXXPred_Invalid + 1,
364 GICXXPred_Simple_IsRule1Enabled,
365 GICXXPred_Simple_IsRule2Enabled,
366 GICXXPred_Simple_IsRule3Enabled,
367 GICXXPred_Simple_IsRule4Enabled,
368 GICXXPred_Simple_IsRule5Enabled,
369 GICXXPred_Simple_IsRule6Enabled,
370 GICXXPred_Simple_IsRule7Enabled,
371 GICXXPred_Simple_IsRule8Enabled,
372 GICXXPred_Simple_IsRule9Enabled,
373 GICXXPred_Simple_IsRule10Enabled,
374 GICXXPred_Simple_IsRule11Enabled,
375 GICXXPred_Simple_IsRule12Enabled,
376 GICXXPred_Simple_IsRule13Enabled,
377 GICXXPred_Simple_IsRule14Enabled,
378 GICXXPred_Simple_IsRule15Enabled,
379 GICXXPred_Simple_IsRule16Enabled,
380 GICXXPred_Simple_IsRule17Enabled,
381};
382
383bool AArch64O0PreLegalizerCombinerImpl::testSimplePredicate(unsigned Predicate) const {
384 return RuleConfig.isRuleEnabled(Predicate - GICXXPred_Invalid - 1);
385}
386// Custom renderers.
387enum {
388 GICR_Invalid,
389};
390AArch64O0PreLegalizerCombinerImpl::CustomRendererFn
391AArch64O0PreLegalizerCombinerImpl::CustomRenderers[] = {
392 nullptr, // GICR_Invalid
393};
394
395bool AArch64O0PreLegalizerCombinerImpl::canMatchOpcode(unsigned Opc) const {
396 switch (Opc) {
397 case TargetOpcode::G_MEMCPY:
398 case TargetOpcode::G_MEMMOVE:
399 case TargetOpcode::G_MEMSET:
400 case TargetOpcode::G_SHUFFLE_VECTOR:
401 case TargetOpcode::G_ADD:
402 case TargetOpcode::G_AND:
403 case TargetOpcode::G_MEMCPY_INLINE:
404 case TargetOpcode::G_MEMSET_INLINE:
405 case TargetOpcode::G_MUL:
406 case TargetOpcode::G_PTR_ADD:
407 case TargetOpcode::G_SUB:
408 case TargetOpcode::G_XOR:
409 case TargetOpcode::COPY:
410 case TargetOpcode::G_CONCAT_VECTORS:
411 case TargetOpcode::G_FABS:
412 case TargetOpcode::G_FCANONICALIZE:
413 case TargetOpcode::G_FREEZE:
414 case TargetOpcode::G_LOAD:
415 case TargetOpcode::G_SEXTLOAD:
416 case TargetOpcode::G_ZEXTLOAD:
417 return true;
418 default:
419 return false;
420 }
421}
422
423uint32_t AArch64O0PreLegalizerCombinerImpl::getRootFlagsToDrop() const {
424 return MachineInstr::getPoisonGeneratingFlags();
425}
426
427bool AArch64O0PreLegalizerCombinerImpl::tryCombineAllImpl(MachineInstr &I) const {
428 const PredicateBitset AvailableFeatures = getAvailableFeatures();
429 State.MIs.clear();
430 State.MIs.push_back(&I);
431 if (executeMatchTable(*this, State, ExecInfo, B, getMatchTable(), Helper.getTII(), MRI, Helper.getTRI(), Helper.getRBI(), AvailableFeatures, /*CoverageInfo*/ nullptr)) {
432 return true;
433 }
434
435 return false;
436}
437
438enum {
439 GICXXCustomAction_GICombiner0 = GICXXCustomAction_Invalid + 1,
440 GICXXCustomAction_GICombiner1,
441 GICXXCustomAction_GICombiner2,
442 GICXXCustomAction_GICombiner3,
443 GICXXCustomAction_GICombiner4,
444 GICXXCustomAction_GICombiner5,
445 GICXXCustomAction_GICombiner6,
446 GICXXCustomAction_GICombiner7,
447 GICXXCustomAction_GICombiner8,
448 GICXXCustomAction_GICombiner9,
449 GICXXCustomAction_GICombiner10,
450 GICXXCustomAction_GICombiner11,
451};
452bool AArch64O0PreLegalizerCombinerImpl::runCustomAction(unsigned ApplyID, const MatcherState &State, NewMIVector &OutMIs) const {
453 Helper.getBuilder().setInstrAndDebugLoc(*State.MIs[0]);
454 switch(ApplyID) {
455 case GICXXCustomAction_GICombiner0:{
456 // Match Patterns
457 if(![&](){return Helper.matchCombineCopy(*State.MIs[0]);}()) {
458 return false;
459 }
460 // Apply Patterns
461 Helper.applyCombineCopy(*State.MIs[0]);
462 return true;
463 }
464 case GICXXCustomAction_GICombiner1:{
465 unsigned GIMatchData_matchinfo;
466 // Match Patterns
467 if(![&](){return Helper.matchCombineMulToShl(*State.MIs[0], GIMatchData_matchinfo);}()) {
468 return false;
469 }
470 // Apply Patterns
471 Helper.applyCombineMulToShl(*State.MIs[0], GIMatchData_matchinfo);
472 return true;
473 }
474 case GICXXCustomAction_GICombiner2:{
475 std::function<void(MachineIRBuilder &)> GIMatchData_matchinfo;
476 // Match Patterns
477 if(![&](){return Helper.matchCombineSubToAdd(*State.MIs[0], GIMatchData_matchinfo);}()) {
478 return false;
479 }
480 // Apply Patterns
481 Helper.applyBuildFnNoErase(*State.MIs[0], GIMatchData_matchinfo);
482 return true;
483 }
484 case GICXXCustomAction_GICombiner3:{
485 PtrAddChain GIMatchData_matchinfo;
486 // Match Patterns
487 if(![&](){return Helper.matchPtrAddImmedChain(*State.MIs[0], GIMatchData_matchinfo);}()) {
488 return false;
489 }
490 // Apply Patterns
491 Helper.applyPtrAddImmedChain(*State.MIs[0], GIMatchData_matchinfo);
492 return true;
493 }
494 case GICXXCustomAction_GICombiner4:{
495 PreferredTuple GIMatchData_matchinfo;
496 // Match Patterns
497 if(![&](){return Helper.matchCombineExtendingLoads(*State.MIs[0], GIMatchData_matchinfo);}()) {
498 return false;
499 }
500 // Apply Patterns
501 Helper.applyCombineExtendingLoads(*State.MIs[0], GIMatchData_matchinfo);
502 return true;
503 }
504 case GICXXCustomAction_GICombiner5:{
505 std::function<void(MachineIRBuilder &)> GIMatchData_matchinfo;
506 // Match Patterns
507 if(![&](){return Helper.matchCombineLoadWithAndMask(*State.MIs[0], GIMatchData_matchinfo);}()) {
508 return false;
509 }
510 // Apply Patterns
511 Helper.applyBuildFn(*State.MIs[0], GIMatchData_matchinfo);
512 return true;
513 }
514 case GICXXCustomAction_GICombiner6:{
515 SmallVector<Register> GIMatchData_info;
516 // Match Patterns
517 if(![&](){return Helper.matchNotCmp(*State.MIs[0], GIMatchData_info);}()) {
518 return false;
519 }
520 // Apply Patterns
521 Helper.applyNotCmp(*State.MIs[0], GIMatchData_info);
522 return true;
523 }
524 case GICXXCustomAction_GICombiner7:{
525 SmallVector<Register> GIMatchData_matchinfo;
526 // Match Patterns
527 if(![&](){return Helper.matchCombineConcatVectors(*State.MIs[0], GIMatchData_matchinfo);}()) {
528 return false;
529 }
530 // Apply Patterns
531 Helper.applyCombineConcatVectors(*State.MIs[0], GIMatchData_matchinfo);
532 return true;
533 }
534 case GICXXCustomAction_GICombiner8:{
535 SmallVector<Register> GIMatchData_matchinfo;
536 // Match Patterns
537 if(![&](){return Helper.matchCombineShuffleVector(*State.MIs[0], GIMatchData_matchinfo);}()) {
538 return false;
539 }
540 // Apply Patterns
541 Helper.applyCombineShuffleVector(*State.MIs[0], GIMatchData_matchinfo);
542 return true;
543 }
544 case GICXXCustomAction_GICombiner9:{
545 MemCpyFamilyLoweringInfo GIMatchData_matchinfo;
546 // Match Patterns
547 if(![&](){return Helper.matchCombineMemCpyFamily(*State.MIs[0], GIMatchData_matchinfo);}()) {
548 return false;
549 }
550 // Apply Patterns
551 Helper.applyCombineMemCpyFamily(*State.MIs[0], GIMatchData_matchinfo);
552 return true;
553 }
554 case GICXXCustomAction_GICombiner10:{
555 MemCpyFamilyLoweringInfo GIMatchData_matchinfo;
556 // Match Patterns
557 if(![&](){return Helper.matchCombineMemCpyFamily(*State.MIs[0], GIMatchData_matchinfo,
558 CInfo.EnableOpt ? 0 : 32);}()) {
559 return false;
560 }
561 // Apply Patterns
562 Helper.applyCombineMemCpyFamily(*State.MIs[0], GIMatchData_matchinfo);
563 return true;
564 }
565 case GICXXCustomAction_GICombiner11:{
566 // Match Patterns
567 if(![&](){return llvm::AArch64GISelUtils::matchEmitBZero(*State.MIs[0], MRI,
568 Libcalls,
569 CInfo.EnableMinSize);}()) {
570 return false;
571 }
572 // Apply Patterns
573 llvm::AArch64GISelUtils::applyEmitBZero(*State.MIs[0], B);
574 return true;
575 }
576 }
577 llvm_unreachable("Unknown Apply Action");
578}
579#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
580#define GIMT_Encode2(Val) uint8_t(Val), uint8_t((Val) >> 8)
581#define GIMT_Encode4(Val) uint8_t(Val), uint8_t((Val) >> 8), uint8_t((Val) >> 16), uint8_t((Val) >> 24)
582#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)
583#else
584#define GIMT_Encode2(Val) uint8_t((Val) >> 8), uint8_t(Val)
585#define GIMT_Encode4(Val) uint8_t((Val) >> 24), uint8_t((Val) >> 16), uint8_t((Val) >> 8), uint8_t(Val)
586#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)
587#endif
588const uint8_t *AArch64O0PreLegalizerCombinerImpl::getMatchTable() const {
589 constexpr static uint8_t MatchTable0[] = {
590 /* 0 */ GIM_SwitchOpcode, /*MI*/0, /*[*/GIMT_Encode2(20), GIMT_Encode2(310), /*)*//*default:*//*Label 20*/ GIMT_Encode4(1627),
591 /* 10 */ /*TargetOpcode::COPY*//*Label 0*/ GIMT_Encode4(1170), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), 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 /* 150 */ /*TargetOpcode::G_ADD*//*Label 1*/ GIMT_Encode4(1182),
593 /* 154 */ /*TargetOpcode::G_SUB*//*Label 2*/ GIMT_Encode4(1293),
594 /* 158 */ /*TargetOpcode::G_MUL*//*Label 3*/ GIMT_Encode4(1315), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
595 /* 186 */ /*TargetOpcode::G_AND*//*Label 4*/ GIMT_Encode4(1367), GIMT_Encode4(0),
596 /* 194 */ /*TargetOpcode::G_XOR*//*Label 5*/ GIMT_Encode4(1379), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), 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 /* 270 */ /*TargetOpcode::G_CONCAT_VECTORS*//*Label 6*/ GIMT_Encode4(1391), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
598 /* 286 */ /*TargetOpcode::G_FREEZE*//*Label 7*/ GIMT_Encode4(1406), GIMT_Encode4(0), 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 /* 326 */ /*TargetOpcode::G_LOAD*//*Label 8*/ GIMT_Encode4(1436),
600 /* 330 */ /*TargetOpcode::G_SEXTLOAD*//*Label 9*/ GIMT_Encode4(1448),
601 /* 334 */ /*TargetOpcode::G_ZEXTLOAD*//*Label 10*/ GIMT_Encode4(1460), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
602 /* 810 */ /*TargetOpcode::G_FABS*//*Label 11*/ GIMT_Encode4(1472), GIMT_Encode4(0), GIMT_Encode4(0),
603 /* 822 */ /*TargetOpcode::G_FCANONICALIZE*//*Label 12*/ GIMT_Encode4(1502), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
604 /* 890 */ /*TargetOpcode::G_PTR_ADD*//*Label 13*/ GIMT_Encode4(1532), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
605 /* 954 */ /*TargetOpcode::G_SHUFFLE_VECTOR*//*Label 14*/ GIMT_Encode4(1544), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
606 /* 1146 */ /*TargetOpcode::G_MEMCPY*//*Label 15*/ GIMT_Encode4(1556),
607 /* 1150 */ /*TargetOpcode::G_MEMCPY_INLINE*//*Label 16*/ GIMT_Encode4(1568),
608 /* 1154 */ /*TargetOpcode::G_MEMMOVE*//*Label 17*/ GIMT_Encode4(1580),
609 /* 1158 */ /*TargetOpcode::G_MEMSET*//*Label 18*/ GIMT_Encode4(1592), GIMT_Encode4(0),
610 /* 1166 */ /*TargetOpcode::G_MEMSET_INLINE*//*Label 19*/ GIMT_Encode4(1615),
611 /* 1170 */ // Label 0: @1170
612 /* 1170 */ GIM_Try, /*On fail goto*//*Label 21*/ GIMT_Encode4(1181), // Rule ID 0 //
613 /* 1175 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule0Enabled),
614 /* 1178 */ // MIs[0] d
615 /* 1178 */ // No operand predicates
616 /* 1178 */ // MIs[0] s
617 /* 1178 */ // No operand predicates
618 /* 1178 */ // Combiner Rule #0: copy_prop
619 /* 1178 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner0),
620 /* 1181 */ // Label 21: @1181
621 /* 1181 */ GIM_Reject,
622 /* 1182 */ // Label 1: @1182
623 /* 1182 */ GIM_Try, /*On fail goto*//*Label 22*/ GIMT_Encode4(1237), // Rule ID 3 //
624 /* 1187 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule3Enabled),
625 /* 1190 */ // MIs[0] dst
626 /* 1190 */ // No operand predicates
627 /* 1190 */ // MIs[0] __add_p2i_to_ptradd_match_0.x
628 /* 1190 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
629 /* 1194 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_PTRTOINT),
630 /* 1198 */ // MIs[1] ptr
631 /* 1198 */ GIM_RecordRegType, /*MI*/1, /*Op*/1, /*TempTypeIdx*/255,
632 /* 1202 */ // MIs[0] other
633 /* 1202 */ // No operand predicates
634 /* 1202 */ GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner0),
635 /* 1206 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
636 /* 1208 */ GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/255,
637 /* 1211 */ // Combiner Rule #3: add_p2i_to_ptradd @ [__add_p2i_to_ptradd_match_0[0]]
638 /* 1211 */ GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(TargetOpcode::G_PTR_ADD),
639 /* 1214 */ GIR_AddTempRegister, /*InsnID*/0, /*TempRegID*/0, /*TempRegFlags*/GIMT_Encode2(static_cast<uint16_t>(RegState::Define)),
640 /* 1219 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // ptr
641 /* 1223 */ GIR_RootToRootCopy, /*OpIdx*/2, // other
642 /* 1225 */ GIR_BuildMI, /*InsnID*/1, /*Opcode*/GIMT_Encode2(TargetOpcode::G_PTRTOINT),
643 /* 1229 */ GIR_Copy, /*NewInsnID*/1, /*OldInsnID*/0, /*OpIdx*/0, // dst
644 /* 1233 */ GIR_AddSimpleTempRegister, /*InsnID*/1, /*TempRegID*/0,
645 /* 1236 */ GIR_EraseRootFromParent_Done,
646 /* 1237 */ // Label 22: @1237
647 /* 1237 */ GIM_Try, /*On fail goto*//*Label 23*/ GIMT_Encode4(1292), // Rule ID 4 //
648 /* 1242 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule3Enabled),
649 /* 1245 */ // MIs[0] dst
650 /* 1245 */ // No operand predicates
651 /* 1245 */ // MIs[0] other
652 /* 1245 */ // No operand predicates
653 /* 1245 */ // MIs[0] __add_p2i_to_ptradd_match_0.x
654 /* 1245 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1]
655 /* 1249 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_PTRTOINT),
656 /* 1253 */ // MIs[1] ptr
657 /* 1253 */ GIM_RecordRegType, /*MI*/1, /*Op*/1, /*TempTypeIdx*/255,
658 /* 1257 */ GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner0),
659 /* 1261 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
660 /* 1263 */ GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/255,
661 /* 1266 */ // Combiner Rule #3: add_p2i_to_ptradd @ [__add_p2i_to_ptradd_match_0[1]]
662 /* 1266 */ GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(TargetOpcode::G_PTR_ADD),
663 /* 1269 */ GIR_AddTempRegister, /*InsnID*/0, /*TempRegID*/0, /*TempRegFlags*/GIMT_Encode2(static_cast<uint16_t>(RegState::Define)),
664 /* 1274 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // ptr
665 /* 1278 */ GIR_RootToRootCopy, /*OpIdx*/1, // other
666 /* 1280 */ GIR_BuildMI, /*InsnID*/1, /*Opcode*/GIMT_Encode2(TargetOpcode::G_PTRTOINT),
667 /* 1284 */ GIR_Copy, /*NewInsnID*/1, /*OldInsnID*/0, /*OpIdx*/0, // dst
668 /* 1288 */ GIR_AddSimpleTempRegister, /*InsnID*/1, /*TempRegID*/0,
669 /* 1291 */ GIR_EraseRootFromParent_Done,
670 /* 1292 */ // Label 23: @1292
671 /* 1292 */ GIM_Reject,
672 /* 1293 */ // Label 2: @1293
673 /* 1293 */ GIM_Try, /*On fail goto*//*Label 24*/ GIMT_Encode4(1314), // Rule ID 2 //
674 /* 1298 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule2Enabled),
675 /* 1301 */ // MIs[0] d
676 /* 1301 */ // No operand predicates
677 /* 1301 */ // MIs[0] op1
678 /* 1301 */ // No operand predicates
679 /* 1301 */ // MIs[0] c
680 /* 1301 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1]
681 /* 1305 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_CONSTANT),
682 /* 1309 */ // MIs[1] imm
683 /* 1309 */ // No operand predicates
684 /* 1309 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
685 /* 1311 */ // Combiner Rule #2: sub_to_add
686 /* 1311 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner2),
687 /* 1314 */ // Label 24: @1314
688 /* 1314 */ GIM_Reject,
689 /* 1315 */ // Label 3: @1315
690 /* 1315 */ GIM_Try, /*On fail goto*//*Label 25*/ GIMT_Encode4(1355), // Rule ID 5 //
691 /* 1320 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule4Enabled),
692 /* 1323 */ // MIs[0] dst
693 /* 1323 */ GIM_RecordRegType, /*MI*/0, /*Op*/0, /*TempTypeIdx*/255,
694 /* 1327 */ // MIs[0] x
695 /* 1327 */ // No operand predicates
696 /* 1327 */ // MIs[0] Operand 2
697 /* 1327 */ GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 255,
698 /* 1331 */ GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/255,
699 /* 1334 */ GIR_BuildConstant, /*TempRegID*/0, /*Val*/GIMT_Encode8(0),
700 /* 1344 */ // Combiner Rule #4: mul_by_neg_one
701 /* 1344 */ GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(TargetOpcode::G_SUB),
702 /* 1347 */ GIR_RootToRootCopy, /*OpIdx*/0, // dst
703 /* 1349 */ GIR_AddSimpleTempRegister, /*InsnID*/0, /*TempRegID*/0,
704 /* 1352 */ GIR_RootToRootCopy, /*OpIdx*/1, // x
705 /* 1354 */ GIR_EraseRootFromParent_Done,
706 /* 1355 */ // Label 25: @1355
707 /* 1355 */ GIM_Try, /*On fail goto*//*Label 26*/ GIMT_Encode4(1366), // Rule ID 1 //
708 /* 1360 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule1Enabled),
709 /* 1363 */ // MIs[0] d
710 /* 1363 */ // No operand predicates
711 /* 1363 */ // MIs[0] op1
712 /* 1363 */ // No operand predicates
713 /* 1363 */ // MIs[0] op2
714 /* 1363 */ // No operand predicates
715 /* 1363 */ // Combiner Rule #1: mul_to_shl
716 /* 1363 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner1),
717 /* 1366 */ // Label 26: @1366
718 /* 1366 */ GIM_Reject,
719 /* 1367 */ // Label 4: @1367
720 /* 1367 */ GIM_Try, /*On fail goto*//*Label 27*/ GIMT_Encode4(1378), // Rule ID 13 //
721 /* 1372 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule8Enabled),
722 /* 1375 */ // MIs[0] dst
723 /* 1375 */ // No operand predicates
724 /* 1375 */ // MIs[0] src1
725 /* 1375 */ // No operand predicates
726 /* 1375 */ // MIs[0] src2
727 /* 1375 */ // No operand predicates
728 /* 1375 */ // Combiner Rule #8: load_and_mask
729 /* 1375 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner5),
730 /* 1378 */ // Label 27: @1378
731 /* 1378 */ GIM_Reject,
732 /* 1379 */ // Label 5: @1379
733 /* 1379 */ GIM_Try, /*On fail goto*//*Label 28*/ GIMT_Encode4(1390), // Rule ID 14 //
734 /* 1384 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule9Enabled),
735 /* 1387 */ // MIs[0] dst
736 /* 1387 */ // No operand predicates
737 /* 1387 */ // MIs[0] src1
738 /* 1387 */ // No operand predicates
739 /* 1387 */ // MIs[0] src2
740 /* 1387 */ // No operand predicates
741 /* 1387 */ // Combiner Rule #9: not_cmp_fold
742 /* 1387 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner6),
743 /* 1390 */ // Label 28: @1390
744 /* 1390 */ GIM_Reject,
745 /* 1391 */ // Label 6: @1391
746 /* 1391 */ GIM_Try, /*On fail goto*//*Label 29*/ GIMT_Encode4(1405), // Rule ID 15 //
747 /* 1396 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule10Enabled),
748 /* 1399 */ GIM_CheckNumOperandsGE, /*MI*/0, /*Expected*/2,
749 /* 1402 */ // MIs[0] dst
750 /* 1402 */ // No operand predicates
751 /* 1402 */ // MIs[0] srcs
752 /* 1402 */ // No operand predicates
753 /* 1402 */ // Combiner Rule #10: combine_concat_vector
754 /* 1402 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner7),
755 /* 1405 */ // Label 29: @1405
756 /* 1405 */ GIM_Reject,
757 /* 1406 */ // Label 7: @1406
758 /* 1406 */ GIM_Try, /*On fail goto*//*Label 30*/ GIMT_Encode4(1435), // Rule ID 6 //
759 /* 1411 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule5Enabled),
760 /* 1414 */ // MIs[0] dst
761 /* 1414 */ // No operand predicates
762 /* 1414 */ // MIs[0] src
763 /* 1414 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
764 /* 1418 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_FREEZE),
765 /* 1422 */ // MIs[1] __idempotent_prop_match_0.x
766 /* 1422 */ // No operand predicates
767 /* 1422 */ GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
768 /* 1427 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
769 /* 1429 */ // Combiner Rule #5: idempotent_prop @ [__idempotent_prop_match_0[0]]
770 /* 1429 */ GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
771 /* 1434 */ GIR_EraseRootFromParent_Done,
772 /* 1435 */ // Label 30: @1435
773 /* 1435 */ GIM_Reject,
774 /* 1436 */ // Label 8: @1436
775 /* 1436 */ GIM_Try, /*On fail goto*//*Label 31*/ GIMT_Encode4(1447), // Rule ID 10 //
776 /* 1441 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule7Enabled),
777 /* 1444 */ // Combiner Rule #7: extending_loads; wip_match_opcode 'G_LOAD'
778 /* 1444 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner4),
779 /* 1447 */ // Label 31: @1447
780 /* 1447 */ GIM_Reject,
781 /* 1448 */ // Label 9: @1448
782 /* 1448 */ GIM_Try, /*On fail goto*//*Label 32*/ GIMT_Encode4(1459), // Rule ID 11 //
783 /* 1453 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule7Enabled),
784 /* 1456 */ // Combiner Rule #7: extending_loads; wip_match_opcode 'G_SEXTLOAD'
785 /* 1456 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner4),
786 /* 1459 */ // Label 32: @1459
787 /* 1459 */ GIM_Reject,
788 /* 1460 */ // Label 10: @1460
789 /* 1460 */ GIM_Try, /*On fail goto*//*Label 33*/ GIMT_Encode4(1471), // Rule ID 12 //
790 /* 1465 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule7Enabled),
791 /* 1468 */ // Combiner Rule #7: extending_loads; wip_match_opcode 'G_ZEXTLOAD'
792 /* 1468 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner4),
793 /* 1471 */ // Label 33: @1471
794 /* 1471 */ GIM_Reject,
795 /* 1472 */ // Label 11: @1472
796 /* 1472 */ GIM_Try, /*On fail goto*//*Label 34*/ GIMT_Encode4(1501), // Rule ID 7 //
797 /* 1477 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule5Enabled),
798 /* 1480 */ // MIs[0] dst
799 /* 1480 */ // No operand predicates
800 /* 1480 */ // MIs[0] src
801 /* 1480 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
802 /* 1484 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_FABS),
803 /* 1488 */ // MIs[1] __idempotent_prop_match_0.x
804 /* 1488 */ // No operand predicates
805 /* 1488 */ GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
806 /* 1493 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
807 /* 1495 */ // Combiner Rule #5: idempotent_prop @ [__idempotent_prop_match_0[1]]
808 /* 1495 */ GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
809 /* 1500 */ GIR_EraseRootFromParent_Done,
810 /* 1501 */ // Label 34: @1501
811 /* 1501 */ GIM_Reject,
812 /* 1502 */ // Label 12: @1502
813 /* 1502 */ GIM_Try, /*On fail goto*//*Label 35*/ GIMT_Encode4(1531), // Rule ID 8 //
814 /* 1507 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule5Enabled),
815 /* 1510 */ // MIs[0] dst
816 /* 1510 */ // No operand predicates
817 /* 1510 */ // MIs[0] src
818 /* 1510 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
819 /* 1514 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_FCANONICALIZE),
820 /* 1518 */ // MIs[1] __idempotent_prop_match_0.x
821 /* 1518 */ // No operand predicates
822 /* 1518 */ GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
823 /* 1523 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
824 /* 1525 */ // Combiner Rule #5: idempotent_prop @ [__idempotent_prop_match_0[2]]
825 /* 1525 */ GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
826 /* 1530 */ GIR_EraseRootFromParent_Done,
827 /* 1531 */ // Label 35: @1531
828 /* 1531 */ GIM_Reject,
829 /* 1532 */ // Label 13: @1532
830 /* 1532 */ GIM_Try, /*On fail goto*//*Label 36*/ GIMT_Encode4(1543), // Rule ID 9 //
831 /* 1537 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule6Enabled),
832 /* 1540 */ // MIs[0] dst
833 /* 1540 */ // No operand predicates
834 /* 1540 */ // MIs[0] base
835 /* 1540 */ // No operand predicates
836 /* 1540 */ // MIs[0] offset
837 /* 1540 */ // No operand predicates
838 /* 1540 */ // Combiner Rule #6: ptr_add_immed_chain
839 /* 1540 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner3),
840 /* 1543 */ // Label 36: @1543
841 /* 1543 */ GIM_Reject,
842 /* 1544 */ // Label 14: @1544
843 /* 1544 */ GIM_Try, /*On fail goto*//*Label 37*/ GIMT_Encode4(1555), // Rule ID 16 //
844 /* 1549 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule11Enabled),
845 /* 1552 */ // MIs[0] dst
846 /* 1552 */ // No operand predicates
847 /* 1552 */ // MIs[0] src1
848 /* 1552 */ // No operand predicates
849 /* 1552 */ // MIs[0] src2
850 /* 1552 */ // No operand predicates
851 /* 1552 */ // MIs[0] mask
852 /* 1552 */ // No operand predicates
853 /* 1552 */ // Combiner Rule #11: combine_shuffle_vector
854 /* 1552 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner8),
855 /* 1555 */ // Label 37: @1555
856 /* 1555 */ GIM_Reject,
857 /* 1556 */ // Label 15: @1556
858 /* 1556 */ GIM_Try, /*On fail goto*//*Label 38*/ GIMT_Encode4(1567), // Rule ID 19 //
859 /* 1561 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule14Enabled),
860 /* 1564 */ // MIs[0] dst_addr
861 /* 1564 */ // No operand predicates
862 /* 1564 */ // MIs[0] src_addr
863 /* 1564 */ // No operand predicates
864 /* 1564 */ // MIs[0] size
865 /* 1564 */ // No operand predicates
866 /* 1564 */ // MIs[0] tailcall
867 /* 1564 */ // No operand predicates
868 /* 1564 */ // Combiner Rule #14: combine_memcpy
869 /* 1564 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner10),
870 /* 1567 */ // Label 38: @1567
871 /* 1567 */ GIM_Reject,
872 /* 1568 */ // Label 16: @1568
873 /* 1568 */ GIM_Try, /*On fail goto*//*Label 39*/ GIMT_Encode4(1579), // Rule ID 17 //
874 /* 1573 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule12Enabled),
875 /* 1576 */ // MIs[0] dst_addr
876 /* 1576 */ // No operand predicates
877 /* 1576 */ // MIs[0] src_addr
878 /* 1576 */ // No operand predicates
879 /* 1576 */ // MIs[0] size
880 /* 1576 */ // No operand predicates
881 /* 1576 */ // Combiner Rule #12: combine_memcpy_inline
882 /* 1576 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner9),
883 /* 1579 */ // Label 39: @1579
884 /* 1579 */ GIM_Reject,
885 /* 1580 */ // Label 17: @1580
886 /* 1580 */ GIM_Try, /*On fail goto*//*Label 40*/ GIMT_Encode4(1591), // Rule ID 20 //
887 /* 1585 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule15Enabled),
888 /* 1588 */ // MIs[0] dst_addr
889 /* 1588 */ // No operand predicates
890 /* 1588 */ // MIs[0] src_addr
891 /* 1588 */ // No operand predicates
892 /* 1588 */ // MIs[0] size
893 /* 1588 */ // No operand predicates
894 /* 1588 */ // MIs[0] tailcall
895 /* 1588 */ // No operand predicates
896 /* 1588 */ // Combiner Rule #15: combine_memmove
897 /* 1588 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner10),
898 /* 1591 */ // Label 40: @1591
899 /* 1591 */ GIM_Reject,
900 /* 1592 */ // Label 18: @1592
901 /* 1592 */ GIM_Try, /*On fail goto*//*Label 41*/ GIMT_Encode4(1603), // Rule ID 21 //
902 /* 1597 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule16Enabled),
903 /* 1600 */ // MIs[0] dst_addr
904 /* 1600 */ // No operand predicates
905 /* 1600 */ // MIs[0] value
906 /* 1600 */ // No operand predicates
907 /* 1600 */ // MIs[0] size
908 /* 1600 */ // No operand predicates
909 /* 1600 */ // MIs[0] tailcall
910 /* 1600 */ // No operand predicates
911 /* 1600 */ // Combiner Rule #16: combine_memset
912 /* 1600 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner10),
913 /* 1603 */ // Label 41: @1603
914 /* 1603 */ GIM_Try, /*On fail goto*//*Label 42*/ GIMT_Encode4(1614), // Rule ID 22 //
915 /* 1608 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule17Enabled),
916 /* 1611 */ // MIs[0] dst_addr
917 /* 1611 */ // No operand predicates
918 /* 1611 */ // MIs[0] value
919 /* 1611 */ // No operand predicates
920 /* 1611 */ // MIs[0] size
921 /* 1611 */ // No operand predicates
922 /* 1611 */ // MIs[0] tailcall
923 /* 1611 */ // No operand predicates
924 /* 1611 */ // Combiner Rule #17: emit_bzero
925 /* 1611 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner11),
926 /* 1614 */ // Label 42: @1614
927 /* 1614 */ GIM_Reject,
928 /* 1615 */ // Label 19: @1615
929 /* 1615 */ GIM_Try, /*On fail goto*//*Label 43*/ GIMT_Encode4(1626), // Rule ID 18 //
930 /* 1620 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule13Enabled),
931 /* 1623 */ // MIs[0] dst_addr
932 /* 1623 */ // No operand predicates
933 /* 1623 */ // MIs[0] value
934 /* 1623 */ // No operand predicates
935 /* 1623 */ // MIs[0] size
936 /* 1623 */ // No operand predicates
937 /* 1623 */ // Combiner Rule #13: combine_memset_inline
938 /* 1623 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner9),
939 /* 1626 */ // Label 43: @1626
940 /* 1626 */ GIM_Reject,
941 /* 1627 */ // Label 20: @1627
942 /* 1627 */ GIM_Reject,
943 /* 1628 */ }; // Size: 1628 bytes
944 return MatchTable0;
945}
946#undef GIMT_Encode2
947#undef GIMT_Encode4
948#undef GIMT_Encode8
949
950
951#endif // GET_GICOMBINER_IMPL
952
953#ifdef GET_GICOMBINER_CONSTRUCTOR_INITS
954
955AvailableModuleFeatures(computeAvailableModuleFeatures(&STI)),
956AvailableFunctionFeatures()
957
958#endif // GET_GICOMBINER_CONSTRUCTOR_INITS
959
960#ifdef GET_GICOMBINER_CONSTRUCTOR_INITS
961
962, State(0),
963ExecInfo(TypeObjects, NumTypeObjects, FeatureBitsets, ComplexPredicateFns, CustomRenderers)
964
965#endif // GET_GICOMBINER_CONSTRUCTOR_INITS
966
967