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 7; // "fullrev"
74 case 11: // 1 string to match.
75 if (memcmp(RuleIdentifier.data()+0, "shuf_to_ins", 11) != 0)
76 break;
77 return 8; // "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
285#endif // GET_GICOMBINER_CLASS_MEMBERS
286
287#ifdef GET_GICOMBINER_CLASS_MEMBERS
288
289PredicateBitset AvailableModuleFeatures;
290mutable PredicateBitset AvailableFunctionFeatures;
291PredicateBitset getAvailableFeatures() const {
292 return AvailableModuleFeatures | AvailableFunctionFeatures;
293}
294PredicateBitset
295computeAvailableModuleFeatures(const AArch64Subtarget *Subtarget) const;
296PredicateBitset
297computeAvailableFunctionFeatures(const AArch64Subtarget *Subtarget,
298 const MachineFunction *MF) const;
299void setupGeneratedPerFunctionState(MachineFunction &MF) override;
300
301#endif // GET_GICOMBINER_CLASS_MEMBERS
302
303#ifdef GET_GICOMBINER_CLASS_MEMBERS
304
305 mutable MatcherState State;
306 typedef ComplexRendererFns(AArch64PostLegalizerLoweringImpl::*ComplexMatcherMemFn)(MachineOperand &) const;
307 typedef void(AArch64PostLegalizerLoweringImpl::*CustomRendererFn)(MachineInstrBuilder &, const MachineInstr &, int) const;
308 const ExecInfoTy<PredicateBitset, ComplexMatcherMemFn, CustomRendererFn> ExecInfo;
309 static AArch64PostLegalizerLoweringImpl::ComplexMatcherMemFn ComplexPredicateFns[];
310 static AArch64PostLegalizerLoweringImpl::CustomRendererFn CustomRenderers[];
311 bool testImmPredicate_I64(unsigned PredicateID, int64_t Imm) const override;
312 bool testImmPredicate_APInt(unsigned PredicateID, const APInt &Imm) const override;
313 bool testImmPredicate_APFloat(unsigned PredicateID, const APFloat &Imm) const override;
314 const uint8_t *getMatchTable() const override;
315 bool testMIPredicate_MI(unsigned PredicateID, const MachineInstr &MI, const MatcherState &State) const override;
316 bool testMOPredicate_MO(unsigned PredicateID, const MachineOperand &MO, const MatcherState &State) const override;
317 bool testSimplePredicate(unsigned PredicateID) const override;
318 bool runCustomAction(unsigned FnID, const MatcherState &State, NewMIVector &OutMIs) const override;
319
320#endif // GET_GICOMBINER_CLASS_MEMBERS
321
322#ifdef GET_GICOMBINER_IMPL
323
324// LLT Objects.
325enum {
326 GILLT_s1,
327};
328const static size_t NumTypeObjects = 1;
329const static LLT TypeObjects[] = {
330 LLT::scalar(1),
331};
332
333// Bits for subtarget features that participate in instruction matching.
334enum SubtargetFeatureBits : uint8_t {
335};
336
337PredicateBitset AArch64PostLegalizerLoweringImpl::
338computeAvailableModuleFeatures(const AArch64Subtarget *Subtarget) const {
339 PredicateBitset Features{};
340 return Features;
341}
342
343void AArch64PostLegalizerLoweringImpl::setupGeneratedPerFunctionState(MachineFunction &MF) {
344 AvailableFunctionFeatures = computeAvailableFunctionFeatures((const AArch64Subtarget *)&MF.getSubtarget(), &MF);
345}
346PredicateBitset AArch64PostLegalizerLoweringImpl::
347computeAvailableFunctionFeatures(const AArch64Subtarget *Subtarget, const MachineFunction *MF) const {
348 PredicateBitset Features{};
349 return Features;
350}
351
352// Feature bitsets.
353enum {
354 GIFBS_Invalid,
355};
356constexpr static PredicateBitset FeatureBitsets[] {
357 {}, // GIFBS_Invalid
358};
359
360// ComplexPattern predicates.
361enum {
362 GICP_Invalid,
363};
364// See constructor for table contents
365
366AArch64PostLegalizerLoweringImpl::ComplexMatcherMemFn
367AArch64PostLegalizerLoweringImpl::ComplexPredicateFns[] = {
368 nullptr, // GICP_Invalid
369};
370
371enum {
372 GICXXPred_MI_Predicate_GICombiner0 = GICXXPred_Invalid + 1,
373};
374bool AArch64PostLegalizerLoweringImpl::testMIPredicate_MI(unsigned PredicateID, const MachineInstr & MI, const MatcherState &State) const {
375 switch (PredicateID) {
376 case GICXXPred_MI_Predicate_GICombiner0: {
377 return MRI.getType(State.MIs[0]->getOperand(0).getReg()).getSizeInBits() == 64;
378 }
379 }
380 llvm_unreachable("Unknown predicate");
381 return false;
382}
383bool AArch64PostLegalizerLoweringImpl::testMOPredicate_MO(unsigned PredicateID, const MachineOperand & MO, const MatcherState &State) const {
384 llvm_unreachable("Unknown predicate");
385 return false;
386}
387bool AArch64PostLegalizerLoweringImpl::testImmPredicate_I64(unsigned PredicateID, int64_t Imm) const {
388 llvm_unreachable("Unknown predicate");
389 return false;
390}
391bool AArch64PostLegalizerLoweringImpl::testImmPredicate_APFloat(unsigned PredicateID, const APFloat & Imm) const {
392 llvm_unreachable("Unknown predicate");
393 return false;
394}
395bool AArch64PostLegalizerLoweringImpl::testImmPredicate_APInt(unsigned PredicateID, const APInt & Imm) const {
396 llvm_unreachable("Unknown predicate");
397 return false;
398}
399enum {
400 GICXXPred_Simple_IsRule0Enabled = GICXXPred_Invalid + 1,
401 GICXXPred_Simple_IsRule1Enabled,
402 GICXXPred_Simple_IsRule2Enabled,
403 GICXXPred_Simple_IsRule3Enabled,
404 GICXXPred_Simple_IsRule4Enabled,
405 GICXXPred_Simple_IsRule5Enabled,
406 GICXXPred_Simple_IsRule6Enabled,
407 GICXXPred_Simple_IsRule7Enabled,
408 GICXXPred_Simple_IsRule8Enabled,
409 GICXXPred_Simple_IsRule9Enabled,
410 GICXXPred_Simple_IsRule10Enabled,
411 GICXXPred_Simple_IsRule11Enabled,
412 GICXXPred_Simple_IsRule12Enabled,
413 GICXXPred_Simple_IsRule13Enabled,
414 GICXXPred_Simple_IsRule14Enabled,
415 GICXXPred_Simple_IsRule15Enabled,
416 GICXXPred_Simple_IsRule16Enabled,
417 GICXXPred_Simple_IsRule17Enabled,
418 GICXXPred_Simple_IsRule18Enabled,
419 GICXXPred_Simple_IsRule19Enabled,
420 GICXXPred_Simple_IsRule20Enabled,
421 GICXXPred_Simple_IsRule21Enabled,
422 GICXXPred_Simple_IsRule22Enabled,
423 GICXXPred_Simple_IsRule23Enabled,
424 GICXXPred_Simple_IsRule24Enabled,
425 GICXXPred_Simple_IsRule25Enabled,
426 GICXXPred_Simple_IsRule26Enabled,
427};
428
429bool AArch64PostLegalizerLoweringImpl::testSimplePredicate(unsigned Predicate) const {
430 return RuleConfig.isRuleEnabled(Predicate - GICXXPred_Invalid - 1);
431}
432// Custom renderers.
433enum {
434 GICR_Invalid,
435};
436AArch64PostLegalizerLoweringImpl::CustomRendererFn
437AArch64PostLegalizerLoweringImpl::CustomRenderers[] = {
438 nullptr, // GICR_Invalid
439};
440
441bool AArch64PostLegalizerLoweringImpl::canMatchOpcode(unsigned Opc) const {
442 switch (Opc) {
443 case TargetOpcode::G_FCMP:
444 case TargetOpcode::G_ICMP:
445 case TargetOpcode::G_SHUFFLE_VECTOR:
446 case TargetOpcode::G_EXTRACT_SUBVECTOR:
447 case TargetOpcode::G_MUL:
448 case TargetOpcode::G_UNMERGE_VALUES:
449 case TargetOpcode::G_BUILD_VECTOR:
450 case TargetOpcode::G_STORE:
451 case TargetOpcode::G_ASHR:
452 case TargetOpcode::G_INSERT_VECTOR_ELT:
453 case TargetOpcode::G_LSHR:
454 case TargetOpcode::G_SEXT_INREG:
455 return true;
456 default:
457 return false;
458 }
459}
460
461bool AArch64PostLegalizerLoweringImpl::tryCombineAll(MachineInstr &I) const {
462 const PredicateBitset AvailableFeatures = getAvailableFeatures();
463 State.MIs.clear();
464 State.MIs.push_back(&I);
465 if (executeMatchTable(*this, State, ExecInfo, B, getMatchTable(), Helper.getTII(), MRI, Helper.getTRI(), Helper.getRBI(), AvailableFeatures, /*CoverageInfo*/ nullptr)) {
466 return true;
467 }
468
469 return false;
470}
471
472enum {
473 GICXXCustomAction_GICombiner0 = GICXXCustomAction_Invalid + 1,
474 GICXXCustomAction_GICombiner1,
475 GICXXCustomAction_GICombiner2,
476 GICXXCustomAction_GICombiner3,
477 GICXXCustomAction_GICombiner4,
478 GICXXCustomAction_GICombiner5,
479 GICXXCustomAction_GICombiner6,
480 GICXXCustomAction_GICombiner7,
481 GICXXCustomAction_GICombiner8,
482 GICXXCustomAction_GICombiner9,
483 GICXXCustomAction_GICombiner10,
484 GICXXCustomAction_GICombiner11,
485 GICXXCustomAction_GICombiner12,
486 GICXXCustomAction_GICombiner13,
487 GICXXCustomAction_GICombiner14,
488 GICXXCustomAction_GICombiner15,
489 GICXXCustomAction_GICombiner16,
490 GICXXCustomAction_GICombiner17,
491 GICXXCustomAction_GICombiner18,
492 GICXXCustomAction_GICombiner19,
493 GICXXCustomAction_GICombiner20,
494};
495bool AArch64PostLegalizerLoweringImpl::runCustomAction(unsigned ApplyID, const MatcherState &State, NewMIVector &OutMIs) const {
496 Helper.getBuilder().setInstrAndDebugLoc(*State.MIs[0]);
497 switch(ApplyID) {
498 case GICXXCustomAction_GICombiner0:{
499 ShuffleVectorPseudo GIMatchData_matchinfo;
500 // Match Patterns
501 if(![&](){return matchDup(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
502 return false;
503 }
504 // Apply Patterns
505 applyShuffleVectorPseudo(*State.MIs[0], MRI, GIMatchData_matchinfo);
506 return true;
507 }
508 case GICXXCustomAction_GICombiner1:{
509 std::pair<unsigned, int> GIMatchData_matchinfo;
510 // Match Patterns
511 if(![&](){return matchDupLane(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
512 return false;
513 }
514 // Apply Patterns
515 applyDupLane(*State.MIs[0], MRI, B, GIMatchData_matchinfo);
516 return true;
517 }
518 case GICXXCustomAction_GICombiner2:{
519 ShuffleVectorPseudo GIMatchData_matchinfo;
520 // Match Patterns
521 if(![&](){return matchREV(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
522 return false;
523 }
524 // Apply Patterns
525 applyShuffleVectorPseudo(*State.MIs[0], MRI, GIMatchData_matchinfo);
526 return true;
527 }
528 case GICXXCustomAction_GICombiner3:{
529 ShuffleVectorPseudo GIMatchData_matchinfo;
530 // Match Patterns
531 if(![&](){return matchEXT(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
532 return false;
533 }
534 // Apply Patterns
535 applyEXT(*State.MIs[0], GIMatchData_matchinfo);
536 return true;
537 }
538 case GICXXCustomAction_GICombiner4:{
539 ShuffleVectorPseudo GIMatchData_matchinfo;
540 // Match Patterns
541 if(![&](){return matchZip(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
542 return false;
543 }
544 // Apply Patterns
545 applyShuffleVectorPseudo(*State.MIs[0], MRI, GIMatchData_matchinfo);
546 return true;
547 }
548 case GICXXCustomAction_GICombiner5:{
549 ShuffleVectorPseudo GIMatchData_matchinfo;
550 // Match Patterns
551 if(![&](){return matchUZP(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
552 return false;
553 }
554 // Apply Patterns
555 applyShuffleVectorPseudo(*State.MIs[0], MRI, GIMatchData_matchinfo);
556 return true;
557 }
558 case GICXXCustomAction_GICombiner6:{
559 ShuffleVectorPseudo GIMatchData_matchinfo;
560 // Match Patterns
561 if(![&](){return matchTRN(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
562 return false;
563 }
564 // Apply Patterns
565 applyShuffleVectorPseudo(*State.MIs[0], MRI, GIMatchData_matchinfo);
566 return true;
567 }
568 case GICXXCustomAction_GICombiner7:{
569 ShuffleVectorPseudo GIMatchData_matchinfo;
570 // Match Patterns
571 if(![&](){return ShuffleVectorInst::isReverseMask(State.MIs[0]->getOperand(3).getShuffleMask(),
572 State.MIs[0]->getOperand(3).getShuffleMask().size());}()) {
573 return false;
574 }
575 // Apply Patterns
576 applyFullRev(*State.MIs[0], MRI);
577 return true;
578 }
579 case GICXXCustomAction_GICombiner8:{
580 std::tuple<Register, int, Register, int> GIMatchData_matchinfo;
581 // Match Patterns
582 if(![&](){return matchINS(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
583 return false;
584 }
585 // Apply Patterns
586 applyINS(*State.MIs[0], MRI, B, GIMatchData_matchinfo);
587 return true;
588 }
589 case GICXXCustomAction_GICombiner9:{
590 int64_t GIMatchData_matchinfo;
591 // Match Patterns
592 if(![&](){return matchVAshrLshrImm(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
593 return false;
594 }
595 // Apply Patterns
596 applyVAshrLshrImm(*State.MIs[0], MRI, GIMatchData_matchinfo);
597 return true;
598 }
599 case GICXXCustomAction_GICombiner10:{
600 std::pair<uint64_t, CmpInst::Predicate> GIMatchData_matchinfo;
601 // Match Patterns
602 if(![&](){return matchAdjustICmpImmAndPred(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
603 return false;
604 }
605 // Apply Patterns
606 applyAdjustICmpImmAndPred(*State.MIs[0], GIMatchData_matchinfo, B, Observer);
607 return true;
608 }
609 case GICXXCustomAction_GICombiner11:{
610 // Match Patterns
611 if(![&](){return trySwapICmpOperands(*State.MIs[0], MRI);}()) {
612 return false;
613 }
614 // Apply Patterns
615 applySwapICmpOperands(*State.MIs[0], Observer);
616 return true;
617 }
618 case GICXXCustomAction_GICombiner12:{
619 Register GIMatchData_matchinfo;
620 // Match Patterns
621 if(![&](){return matchBuildVectorToDup(*State.MIs[0], GIMatchData_matchinfo, MRI);}()) {
622 return false;
623 }
624 // Apply Patterns
625 applyBuildVectorToDup(*State.MIs[0], GIMatchData_matchinfo, MRI, B);
626 return true;
627 }
628 case GICXXCustomAction_GICombiner13:{
629 // Match Patterns
630 if(![&](){return matchLowerBuildToInsertVecElt(*State.MIs[0], MRI);}()) {
631 return false;
632 }
633 // Apply Patterns
634 applyLowerBuildToInsertVecElt(*State.MIs[0], MRI, B);
635 return true;
636 }
637 case GICXXCustomAction_GICombiner14:{
638 // Match Patterns
639 if(![&](){return matchLowerVectorFCMP(*State.MIs[0], MRI, B);}()) {
640 return false;
641 }
642 // Apply Patterns
643 applyLowerVectorFCMP(*State.MIs[0], MRI, B);
644 return true;
645 }
646 case GICXXCustomAction_GICombiner15:{
647 Register GIMatchData_matchinfo;
648 // Match Patterns
649 if(![&](){return matchFormTruncstore(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
650 return false;
651 }
652 // Apply Patterns
653 applyFormTruncstore(*State.MIs[0], MRI, B, Observer, GIMatchData_matchinfo);
654 return true;
655 }
656 case GICXXCustomAction_GICombiner16:{
657 // Match Patterns
658 if(![&](){return matchVectorSextInReg(*State.MIs[0], MRI);}()) {
659 return false;
660 }
661 // Apply Patterns
662 applyVectorSextInReg(*State.MIs[0], MRI, B, Observer);
663 return true;
664 }
665 case GICXXCustomAction_GICombiner17:{
666 Register GIMatchData_matchinfo;
667 // Match Patterns
668 if(![&](){return matchUnmergeExtToUnmerge(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
669 return false;
670 }
671 // Apply Patterns
672 applyUnmergeExtToUnmerge(*State.MIs[0], MRI, B, Observer, GIMatchData_matchinfo);
673 return true;
674 }
675 case GICXXCustomAction_GICombiner18:{
676 // Match Patterns
677 if(![&](){return matchMulv2s64(*State.MIs[0], MRI);}()) {
678 return false;
679 }
680 // Apply Patterns
681 applyMulv2s64(*State.MIs[0], MRI, B, Observer);
682 return true;
683 }
684 case GICXXCustomAction_GICombiner19:{
685 // Match Patterns
686 if(![&](){return matchScalarizeVectorUnmerge(*State.MIs[0], MRI);}()) {
687 return false;
688 }
689 // Apply Patterns
690 applyScalarizeVectorUnmerge(*State.MIs[0], MRI, B);
691 return true;
692 }
693 case GICXXCustomAction_GICombiner20:{
694 ShuffleVectorPseudo GIMatchData_matchinfo;
695 // Match Patterns
696 if(![&](){return matchNonConstInsert(*State.MIs[0], MRI);}()) {
697 return false;
698 }
699 // Apply Patterns
700 applyNonConstInsert(*State.MIs[0], MRI, B);
701 return true;
702 }
703 }
704 llvm_unreachable("Unknown Apply Action");
705}
706#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
707#define GIMT_Encode2(Val) uint8_t(Val), uint8_t((Val) >> 8)
708#define GIMT_Encode4(Val) uint8_t(Val), uint8_t((Val) >> 8), uint8_t((Val) >> 16), uint8_t((Val) >> 24)
709#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)
710#else
711#define GIMT_Encode2(Val) uint8_t((Val) >> 8), uint8_t(Val)
712#define GIMT_Encode4(Val) uint8_t((Val) >> 24), uint8_t((Val) >> 16), uint8_t((Val) >> 8), uint8_t(Val)
713#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)
714#endif
715const uint8_t *AArch64PostLegalizerLoweringImpl::getMatchTable() const {
716 constexpr static uint8_t MatchTable0[] = {
717 /* 0 */ GIM_SwitchOpcode, /*MI*/0, /*[*/GIMT_Encode2(57), GIMT_Encode2(257), /*)*//*default:*//*Label 12*/ GIMT_Encode4(1332),
718 /* 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),
719 /* 102 */ /*TargetOpcode::G_UNMERGE_VALUES*//*Label 1*/ GIMT_Encode4(822), GIMT_Encode4(0), GIMT_Encode4(0),
720 /* 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),
721 /* 206 */ /*TargetOpcode::G_STORE*//*Label 3*/ GIMT_Encode4(1018), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
722 /* 394 */ /*TargetOpcode::G_SEXT_INREG*//*Label 4*/ GIMT_Encode4(1030), GIMT_Encode4(0), GIMT_Encode4(0),
723 /* 406 */ /*TargetOpcode::G_LSHR*//*Label 5*/ GIMT_Encode4(1042),
724 /* 410 */ /*TargetOpcode::G_ASHR*//*Label 6*/ GIMT_Encode4(1054), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
725 /* 430 */ /*TargetOpcode::G_ICMP*//*Label 7*/ GIMT_Encode4(1066),
726 /* 434 */ /*TargetOpcode::G_FCMP*//*Label 8*/ GIMT_Encode4(1089), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), 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 /* 794 */ /*TargetOpcode::G_EXTRACT_SUBVECTOR*//*Label 9*/ GIMT_Encode4(1101),
728 /* 798 */ /*TargetOpcode::G_INSERT_VECTOR_ELT*//*Label 10*/ GIMT_Encode4(1210), GIMT_Encode4(0),
729 /* 806 */ /*TargetOpcode::G_SHUFFLE_VECTOR*//*Label 11*/ GIMT_Encode4(1222),
730 /* 810 */ // Label 0: @810
731 /* 810 */ GIM_Try, /*On fail goto*//*Label 13*/ GIMT_Encode4(821), // Rule ID 19 //
732 /* 815 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule18Enabled),
733 /* 818 */ // MIs[0] dst
734 /* 818 */ // No operand predicates
735 /* 818 */ // MIs[0] src1
736 /* 818 */ // No operand predicates
737 /* 818 */ // MIs[0] src2
738 /* 818 */ // No operand predicates
739 /* 818 */ // Combiner Rule #18: lower_mulv2s64
740 /* 818 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner18),
741 /* 821 */ // Label 13: @821
742 /* 821 */ GIM_Reject,
743 /* 822 */ // Label 1: @822
744 /* 822 */ GIM_Try, /*On fail goto*//*Label 14*/ GIMT_Encode4(833), // Rule ID 18 //
745 /* 827 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule17Enabled),
746 /* 830 */ // Combiner Rule #17: unmerge_ext_to_unmerge; wip_match_opcode 'G_UNMERGE_VALUES'
747 /* 830 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner17),
748 /* 833 */ // Label 14: @833
749 /* 833 */ GIM_Try, /*On fail goto*//*Label 15*/ GIMT_Encode4(844), // Rule ID 20 //
750 /* 838 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule19Enabled),
751 /* 841 */ // Combiner Rule #19: vector_unmerge_lowering; wip_match_opcode 'G_UNMERGE_VALUES'
752 /* 841 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner19),
753 /* 844 */ // Label 15: @844
754 /* 844 */ GIM_Try, /*On fail goto*//*Label 16*/ GIMT_Encode4(991),
755 /* 849 */ GIM_CheckNumOperands, /*MI*/0, /*Expected*/3,
756 /* 852 */ GIM_Try, /*On fail goto*//*Label 17*/ GIMT_Encode4(898), // Rule ID 23 //
757 /* 857 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule22Enabled),
758 /* 860 */ // MIs[0] d1
759 /* 860 */ // No operand predicates
760 /* 860 */ // MIs[0] d2
761 /* 860 */ // No operand predicates
762 /* 860 */ // MIs[0] a
763 /* 860 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1]
764 /* 864 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(AArch64::G_DUPLANE16),
765 /* 868 */ // MIs[1] src
766 /* 868 */ // No operand predicates
767 /* 868 */ // MIs[1] c
768 /* 868 */ // No operand predicates
769 /* 868 */ GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner0),
770 /* 872 */ GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/1, /*NewInsnId*/0, /*NewOpIdx*/0,
771 /* 877 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
772 /* 879 */ // Combiner Rule #22: unmerge_duplane16
773 /* 879 */ GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(AArch64::G_DUPLANE16),
774 /* 882 */ GIR_RootToRootCopy, /*OpIdx*/0, // d1
775 /* 884 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src
776 /* 888 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/2, // c
777 /* 892 */ GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/1, /*NewInsnId*/0, /*NewOpIdx*/0,
778 /* 897 */ GIR_EraseRootFromParent_Done,
779 /* 898 */ // Label 17: @898
780 /* 898 */ GIM_Try, /*On fail goto*//*Label 18*/ GIMT_Encode4(944), // Rule ID 24 //
781 /* 903 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule23Enabled),
782 /* 906 */ // MIs[0] d1
783 /* 906 */ // No operand predicates
784 /* 906 */ // MIs[0] d2
785 /* 906 */ // No operand predicates
786 /* 906 */ // MIs[0] a
787 /* 906 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1]
788 /* 910 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(AArch64::G_DUPLANE32),
789 /* 914 */ // MIs[1] src
790 /* 914 */ // No operand predicates
791 /* 914 */ // MIs[1] c
792 /* 914 */ // No operand predicates
793 /* 914 */ GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner0),
794 /* 918 */ GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/1, /*NewInsnId*/0, /*NewOpIdx*/0,
795 /* 923 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
796 /* 925 */ // Combiner Rule #23: unmerge_duplane32
797 /* 925 */ GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(AArch64::G_DUPLANE32),
798 /* 928 */ GIR_RootToRootCopy, /*OpIdx*/0, // d1
799 /* 930 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src
800 /* 934 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/2, // c
801 /* 938 */ GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/1, /*NewInsnId*/0, /*NewOpIdx*/0,
802 /* 943 */ GIR_EraseRootFromParent_Done,
803 /* 944 */ // Label 18: @944
804 /* 944 */ GIM_Try, /*On fail goto*//*Label 19*/ GIMT_Encode4(990), // Rule ID 22 //
805 /* 949 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule21Enabled),
806 /* 952 */ // MIs[0] d1
807 /* 952 */ // No operand predicates
808 /* 952 */ // MIs[0] d2
809 /* 952 */ // No operand predicates
810 /* 952 */ // MIs[0] a
811 /* 952 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1]
812 /* 956 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(AArch64::G_DUPLANE8),
813 /* 960 */ // MIs[1] src
814 /* 960 */ // No operand predicates
815 /* 960 */ // MIs[1] c
816 /* 960 */ // No operand predicates
817 /* 960 */ GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner0),
818 /* 964 */ GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/1, /*NewInsnId*/0, /*NewOpIdx*/0,
819 /* 969 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
820 /* 971 */ // Combiner Rule #21: unmerge_duplane8
821 /* 971 */ GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(AArch64::G_DUPLANE8),
822 /* 974 */ GIR_RootToRootCopy, /*OpIdx*/0, // d1
823 /* 976 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src
824 /* 980 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/2, // c
825 /* 984 */ GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/1, /*NewInsnId*/0, /*NewOpIdx*/0,
826 /* 989 */ GIR_EraseRootFromParent_Done,
827 /* 990 */ // Label 19: @990
828 /* 990 */ GIM_Reject,
829 /* 991 */ // Label 16: @991
830 /* 991 */ GIM_Reject,
831 /* 992 */ // Label 2: @992
832 /* 992 */ GIM_Try, /*On fail goto*//*Label 20*/ GIMT_Encode4(1003), // Rule ID 13 //
833 /* 997 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule12Enabled),
834 /* 1000 */ // Combiner Rule #12: build_vector_to_dup; wip_match_opcode 'G_BUILD_VECTOR'
835 /* 1000 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner12),
836 /* 1003 */ // Label 20: @1003
837 /* 1003 */ GIM_Try, /*On fail goto*//*Label 21*/ GIMT_Encode4(1017), // Rule ID 14 //
838 /* 1008 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule13Enabled),
839 /* 1011 */ GIM_CheckNumOperandsGE, /*MI*/0, /*Expected*/2,
840 /* 1014 */ // MIs[0] dst
841 /* 1014 */ // No operand predicates
842 /* 1014 */ // MIs[0] unused
843 /* 1014 */ // No operand predicates
844 /* 1014 */ // Combiner Rule #13: build_vector_to_vector_insert
845 /* 1014 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner13),
846 /* 1017 */ // Label 21: @1017
847 /* 1017 */ GIM_Reject,
848 /* 1018 */ // Label 3: @1018
849 /* 1018 */ GIM_Try, /*On fail goto*//*Label 22*/ GIMT_Encode4(1029), // Rule ID 16 //
850 /* 1023 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule15Enabled),
851 /* 1026 */ // MIs[0] src
852 /* 1026 */ // No operand predicates
853 /* 1026 */ // MIs[0] addr
854 /* 1026 */ // No operand predicates
855 /* 1026 */ // Combiner Rule #15: form_truncstore
856 /* 1026 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner15),
857 /* 1029 */ // Label 22: @1029
858 /* 1029 */ GIM_Reject,
859 /* 1030 */ // Label 4: @1030
860 /* 1030 */ GIM_Try, /*On fail goto*//*Label 23*/ GIMT_Encode4(1041), // Rule ID 17 //
861 /* 1035 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule16Enabled),
862 /* 1038 */ // Combiner Rule #16: vector_sext_inreg_to_shift; wip_match_opcode 'G_SEXT_INREG'
863 /* 1038 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner16),
864 /* 1041 */ // Label 23: @1041
865 /* 1041 */ GIM_Reject,
866 /* 1042 */ // Label 5: @1042
867 /* 1042 */ GIM_Try, /*On fail goto*//*Label 24*/ GIMT_Encode4(1053), // Rule ID 10 //
868 /* 1047 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule9Enabled),
869 /* 1050 */ // Combiner Rule #9: vashr_vlshr_imm; wip_match_opcode 'G_LSHR'
870 /* 1050 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner9),
871 /* 1053 */ // Label 24: @1053
872 /* 1053 */ GIM_Reject,
873 /* 1054 */ // Label 6: @1054
874 /* 1054 */ GIM_Try, /*On fail goto*//*Label 25*/ GIMT_Encode4(1065), // Rule ID 9 //
875 /* 1059 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule9Enabled),
876 /* 1062 */ // Combiner Rule #9: vashr_vlshr_imm; wip_match_opcode 'G_ASHR'
877 /* 1062 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner9),
878 /* 1065 */ // Label 25: @1065
879 /* 1065 */ GIM_Reject,
880 /* 1066 */ // Label 7: @1066
881 /* 1066 */ GIM_Try, /*On fail goto*//*Label 26*/ GIMT_Encode4(1077), // Rule ID 11 //
882 /* 1071 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule10Enabled),
883 /* 1074 */ // MIs[0] dst
884 /* 1074 */ // No operand predicates
885 /* 1074 */ // MIs[0] tst
886 /* 1074 */ // No operand predicates
887 /* 1074 */ // MIs[0] src1
888 /* 1074 */ // No operand predicates
889 /* 1074 */ // MIs[0] src2
890 /* 1074 */ // No operand predicates
891 /* 1074 */ // Combiner Rule #10: adjust_icmp_imm
892 /* 1074 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner10),
893 /* 1077 */ // Label 26: @1077
894 /* 1077 */ GIM_Try, /*On fail goto*//*Label 27*/ GIMT_Encode4(1088), // Rule ID 12 //
895 /* 1082 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule11Enabled),
896 /* 1085 */ // MIs[0] dst
897 /* 1085 */ // No operand predicates
898 /* 1085 */ // MIs[0] tst
899 /* 1085 */ // No operand predicates
900 /* 1085 */ // MIs[0] src1
901 /* 1085 */ // No operand predicates
902 /* 1085 */ // MIs[0] src2
903 /* 1085 */ // No operand predicates
904 /* 1085 */ // Combiner Rule #11: swap_icmp_operands
905 /* 1085 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner11),
906 /* 1088 */ // Label 27: @1088
907 /* 1088 */ GIM_Reject,
908 /* 1089 */ // Label 8: @1089
909 /* 1089 */ GIM_Try, /*On fail goto*//*Label 28*/ GIMT_Encode4(1100), // Rule ID 15 //
910 /* 1094 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule14Enabled),
911 /* 1097 */ // MIs[0] dst
912 /* 1097 */ // No operand predicates
913 /* 1097 */ // MIs[0] tst
914 /* 1097 */ // No operand predicates
915 /* 1097 */ // MIs[0] src1
916 /* 1097 */ // No operand predicates
917 /* 1097 */ // MIs[0] src2
918 /* 1097 */ // No operand predicates
919 /* 1097 */ // Combiner Rule #14: lower_vector_fcmp
920 /* 1097 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner14),
921 /* 1100 */ // Label 28: @1100
922 /* 1100 */ GIM_Reject,
923 /* 1101 */ // Label 9: @1101
924 /* 1101 */ GIM_Try, /*On fail goto*//*Label 29*/ GIMT_Encode4(1137), // Rule ID 26 //
925 /* 1106 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule25Enabled),
926 /* 1109 */ // MIs[0] d1
927 /* 1109 */ // No operand predicates
928 /* 1109 */ // MIs[0] a
929 /* 1109 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
930 /* 1113 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(AArch64::G_DUPLANE16),
931 /* 1117 */ // MIs[1] src
932 /* 1117 */ // No operand predicates
933 /* 1117 */ // MIs[1] c
934 /* 1117 */ // No operand predicates
935 /* 1117 */ // MIs[0] l
936 /* 1117 */ // No operand predicates
937 /* 1117 */ GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner0),
938 /* 1121 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
939 /* 1123 */ // Combiner Rule #25: extract_duplane16
940 /* 1123 */ GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(AArch64::G_DUPLANE16),
941 /* 1126 */ GIR_RootToRootCopy, /*OpIdx*/0, // d1
942 /* 1128 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src
943 /* 1132 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/2, // c
944 /* 1136 */ GIR_EraseRootFromParent_Done,
945 /* 1137 */ // Label 29: @1137
946 /* 1137 */ GIM_Try, /*On fail goto*//*Label 30*/ GIMT_Encode4(1173), // Rule ID 27 //
947 /* 1142 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule26Enabled),
948 /* 1145 */ // MIs[0] d1
949 /* 1145 */ // No operand predicates
950 /* 1145 */ // MIs[0] a
951 /* 1145 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
952 /* 1149 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(AArch64::G_DUPLANE32),
953 /* 1153 */ // MIs[1] src
954 /* 1153 */ // No operand predicates
955 /* 1153 */ // MIs[1] c
956 /* 1153 */ // No operand predicates
957 /* 1153 */ // MIs[0] l
958 /* 1153 */ // No operand predicates
959 /* 1153 */ GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner0),
960 /* 1157 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
961 /* 1159 */ // Combiner Rule #26: extract_duplane32
962 /* 1159 */ GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(AArch64::G_DUPLANE32),
963 /* 1162 */ GIR_RootToRootCopy, /*OpIdx*/0, // d1
964 /* 1164 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src
965 /* 1168 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/2, // c
966 /* 1172 */ GIR_EraseRootFromParent_Done,
967 /* 1173 */ // Label 30: @1173
968 /* 1173 */ GIM_Try, /*On fail goto*//*Label 31*/ GIMT_Encode4(1209), // Rule ID 25 //
969 /* 1178 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule24Enabled),
970 /* 1181 */ // MIs[0] d1
971 /* 1181 */ // No operand predicates
972 /* 1181 */ // MIs[0] a
973 /* 1181 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
974 /* 1185 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(AArch64::G_DUPLANE8),
975 /* 1189 */ // MIs[1] src
976 /* 1189 */ // No operand predicates
977 /* 1189 */ // MIs[1] c
978 /* 1189 */ // No operand predicates
979 /* 1189 */ // MIs[0] l
980 /* 1189 */ // No operand predicates
981 /* 1189 */ GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner0),
982 /* 1193 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
983 /* 1195 */ // Combiner Rule #24: extract_duplane8
984 /* 1195 */ GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(AArch64::G_DUPLANE8),
985 /* 1198 */ GIR_RootToRootCopy, /*OpIdx*/0, // d1
986 /* 1200 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src
987 /* 1204 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/2, // c
988 /* 1208 */ GIR_EraseRootFromParent_Done,
989 /* 1209 */ // Label 31: @1209
990 /* 1209 */ GIM_Reject,
991 /* 1210 */ // Label 10: @1210
992 /* 1210 */ GIM_Try, /*On fail goto*//*Label 32*/ GIMT_Encode4(1221), // Rule ID 21 //
993 /* 1215 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule20Enabled),
994 /* 1218 */ // Combiner Rule #20: insertelt_nonconst; wip_match_opcode 'G_INSERT_VECTOR_ELT'
995 /* 1218 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner20),
996 /* 1221 */ // Label 32: @1221
997 /* 1221 */ GIM_Reject,
998 /* 1222 */ // Label 11: @1222
999 /* 1222 */ GIM_Try, /*On fail goto*//*Label 33*/ GIMT_Encode4(1233), // Rule ID 0 //
1000 /* 1227 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule0Enabled),
1001 /* 1230 */ // Combiner Rule #0: dup; wip_match_opcode 'G_SHUFFLE_VECTOR'
1002 /* 1230 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner0),
1003 /* 1233 */ // Label 33: @1233
1004 /* 1233 */ GIM_Try, /*On fail goto*//*Label 34*/ GIMT_Encode4(1244), // Rule ID 1 //
1005 /* 1238 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule1Enabled),
1006 /* 1241 */ // Combiner Rule #1: form_duplane; wip_match_opcode 'G_SHUFFLE_VECTOR'
1007 /* 1241 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner1),
1008 /* 1244 */ // Label 34: @1244
1009 /* 1244 */ GIM_Try, /*On fail goto*//*Label 35*/ GIMT_Encode4(1255), // Rule ID 2 //
1010 /* 1249 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule2Enabled),
1011 /* 1252 */ // Combiner Rule #2: rev; wip_match_opcode 'G_SHUFFLE_VECTOR'
1012 /* 1252 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner2),
1013 /* 1255 */ // Label 35: @1255
1014 /* 1255 */ GIM_Try, /*On fail goto*//*Label 36*/ GIMT_Encode4(1266), // Rule ID 3 //
1015 /* 1260 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule3Enabled),
1016 /* 1263 */ // Combiner Rule #3: ext; wip_match_opcode 'G_SHUFFLE_VECTOR'
1017 /* 1263 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner3),
1018 /* 1266 */ // Label 36: @1266
1019 /* 1266 */ GIM_Try, /*On fail goto*//*Label 37*/ GIMT_Encode4(1277), // Rule ID 4 //
1020 /* 1271 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule4Enabled),
1021 /* 1274 */ // Combiner Rule #4: zip; wip_match_opcode 'G_SHUFFLE_VECTOR'
1022 /* 1274 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner4),
1023 /* 1277 */ // Label 37: @1277
1024 /* 1277 */ GIM_Try, /*On fail goto*//*Label 38*/ GIMT_Encode4(1288), // Rule ID 5 //
1025 /* 1282 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule5Enabled),
1026 /* 1285 */ // Combiner Rule #5: uzp; wip_match_opcode 'G_SHUFFLE_VECTOR'
1027 /* 1285 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner5),
1028 /* 1288 */ // Label 38: @1288
1029 /* 1288 */ GIM_Try, /*On fail goto*//*Label 39*/ GIMT_Encode4(1299), // Rule ID 6 //
1030 /* 1293 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule6Enabled),
1031 /* 1296 */ // Combiner Rule #6: trn; wip_match_opcode 'G_SHUFFLE_VECTOR'
1032 /* 1296 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner6),
1033 /* 1299 */ // Label 39: @1299
1034 /* 1299 */ GIM_Try, /*On fail goto*//*Label 40*/ GIMT_Encode4(1310), // Rule ID 8 //
1035 /* 1304 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule8Enabled),
1036 /* 1307 */ // Combiner Rule #8: shuf_to_ins; wip_match_opcode 'G_SHUFFLE_VECTOR'
1037 /* 1307 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner8),
1038 /* 1310 */ // Label 40: @1310
1039 /* 1310 */ GIM_Try, /*On fail goto*//*Label 41*/ GIMT_Encode4(1331), // Rule ID 7 //
1040 /* 1315 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule7Enabled),
1041 /* 1318 */ // MIs[0] src
1042 /* 1318 */ // No operand predicates
1043 /* 1318 */ // MIs[0] src1
1044 /* 1318 */ // No operand predicates
1045 /* 1318 */ // MIs[0] src2
1046 /* 1318 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1]
1047 /* 1322 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_IMPLICIT_DEF),
1048 /* 1326 */ // MIs[0] mask
1049 /* 1326 */ // No operand predicates
1050 /* 1326 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
1051 /* 1328 */ // Combiner Rule #7: fullrev
1052 /* 1328 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner7),
1053 /* 1331 */ // Label 41: @1331
1054 /* 1331 */ GIM_Reject,
1055 /* 1332 */ // Label 12: @1332
1056 /* 1332 */ GIM_Reject,
1057 /* 1333 */ }; // Size: 1333 bytes
1058 return MatchTable0;
1059}
1060#undef GIMT_Encode2
1061#undef GIMT_Encode4
1062#undef GIMT_Encode8
1063
1064
1065#endif // GET_GICOMBINER_IMPL
1066
1067#ifdef GET_GICOMBINER_CONSTRUCTOR_INITS
1068
1069AvailableModuleFeatures(computeAvailableModuleFeatures(&STI)),
1070AvailableFunctionFeatures()
1071
1072#endif // GET_GICOMBINER_CONSTRUCTOR_INITS
1073
1074#ifdef GET_GICOMBINER_CONSTRUCTOR_INITS
1075
1076, State(0),
1077ExecInfo(TypeObjects, NumTypeObjects, FeatureBitsets, ComplexPredicateFns, CustomRenderers)
1078
1079#endif // GET_GICOMBINER_CONSTRUCTOR_INITS
1080
1081