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