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 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_SHUFFLE_VECTOR:
447 case TargetOpcode::G_EXTRACT_SUBVECTOR:
448 case TargetOpcode::G_MUL:
449 case TargetOpcode::G_UNMERGE_VALUES:
450 case TargetOpcode::G_BUILD_VECTOR:
451 case TargetOpcode::G_STORE:
452 case TargetOpcode::G_ASHR:
453 case TargetOpcode::G_INSERT_VECTOR_ELT:
454 case TargetOpcode::G_LSHR:
455 case TargetOpcode::G_SEXT_INREG:
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 ShuffleVectorPseudo GIMatchData_matchinfo;
575 // Match Patterns
576 if(![&](){return ShuffleVectorInst::isReverseMask(State.MIs[0]->getOperand(3).getShuffleMask(),
577 State.MIs[0]->getOperand(3).getShuffleMask().size());}()) {
578 return false;
579 }
580 // Apply Patterns
581 applyFullRev(*State.MIs[0], MRI);
582 return true;
583 }
584 case GICXXCustomAction_GICombiner8:{
585 std::tuple<Register, int, Register, int> GIMatchData_matchinfo;
586 // Match Patterns
587 if(![&](){return matchINS(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
588 return false;
589 }
590 // Apply Patterns
591 applyINS(*State.MIs[0], MRI, B, GIMatchData_matchinfo);
592 return true;
593 }
594 case GICXXCustomAction_GICombiner9:{
595 int64_t GIMatchData_matchinfo;
596 // Match Patterns
597 if(![&](){return matchVAshrLshrImm(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
598 return false;
599 }
600 // Apply Patterns
601 applyVAshrLshrImm(*State.MIs[0], MRI, GIMatchData_matchinfo);
602 return true;
603 }
604 case GICXXCustomAction_GICombiner10:{
605 std::pair<uint64_t, CmpInst::Predicate> GIMatchData_matchinfo;
606 // Match Patterns
607 if(![&](){return matchAdjustICmpImmAndPred(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
608 return false;
609 }
610 // Apply Patterns
611 applyAdjustICmpImmAndPred(*State.MIs[0], GIMatchData_matchinfo, B, Observer);
612 return true;
613 }
614 case GICXXCustomAction_GICombiner11:{
615 // Match Patterns
616 if(![&](){return trySwapICmpOperands(*State.MIs[0], MRI);}()) {
617 return false;
618 }
619 // Apply Patterns
620 applySwapICmpOperands(*State.MIs[0], Observer);
621 return true;
622 }
623 case GICXXCustomAction_GICombiner12:{
624 Register GIMatchData_matchinfo;
625 // Match Patterns
626 if(![&](){return matchBuildVectorToDup(*State.MIs[0], GIMatchData_matchinfo, MRI);}()) {
627 return false;
628 }
629 // Apply Patterns
630 applyBuildVectorToDup(*State.MIs[0], GIMatchData_matchinfo, MRI, B);
631 return true;
632 }
633 case GICXXCustomAction_GICombiner13:{
634 // Match Patterns
635 if(![&](){return matchLowerBuildToInsertVecElt(*State.MIs[0], MRI);}()) {
636 return false;
637 }
638 // Apply Patterns
639 applyLowerBuildToInsertVecElt(*State.MIs[0], MRI, B);
640 return true;
641 }
642 case GICXXCustomAction_GICombiner14:{
643 // Match Patterns
644 if(![&](){return matchLowerVectorFCMP(*State.MIs[0], MRI, B);}()) {
645 return false;
646 }
647 // Apply Patterns
648 applyLowerVectorFCMP(*State.MIs[0], MRI, B);
649 return true;
650 }
651 case GICXXCustomAction_GICombiner15:{
652 Register GIMatchData_matchinfo;
653 // Match Patterns
654 if(![&](){return matchFormTruncstore(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
655 return false;
656 }
657 // Apply Patterns
658 applyFormTruncstore(*State.MIs[0], MRI, B, Observer, GIMatchData_matchinfo);
659 return true;
660 }
661 case GICXXCustomAction_GICombiner16:{
662 // Match Patterns
663 if(![&](){return matchVectorSextInReg(*State.MIs[0], MRI);}()) {
664 return false;
665 }
666 // Apply Patterns
667 applyVectorSextInReg(*State.MIs[0], MRI, B, Observer);
668 return true;
669 }
670 case GICXXCustomAction_GICombiner17:{
671 Register GIMatchData_matchinfo;
672 // Match Patterns
673 if(![&](){return matchUnmergeExtToUnmerge(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
674 return false;
675 }
676 // Apply Patterns
677 applyUnmergeExtToUnmerge(*State.MIs[0], MRI, B, Observer, GIMatchData_matchinfo);
678 return true;
679 }
680 case GICXXCustomAction_GICombiner18:{
681 // Match Patterns
682 if(![&](){return matchMulv2s64(*State.MIs[0], MRI);}()) {
683 return false;
684 }
685 // Apply Patterns
686 applyMulv2s64(*State.MIs[0], MRI, B, Observer);
687 return true;
688 }
689 case GICXXCustomAction_GICombiner19:{
690 // Match Patterns
691 if(![&](){return matchScalarizeVectorUnmerge(*State.MIs[0], MRI);}()) {
692 return false;
693 }
694 // Apply Patterns
695 applyScalarizeVectorUnmerge(*State.MIs[0], MRI, B);
696 return true;
697 }
698 case GICXXCustomAction_GICombiner20:{
699 ShuffleVectorPseudo GIMatchData_matchinfo;
700 // Match Patterns
701 if(![&](){return matchNonConstInsert(*State.MIs[0], MRI);}()) {
702 return false;
703 }
704 // Apply Patterns
705 applyNonConstInsert(*State.MIs[0], MRI, B);
706 return true;
707 }
708 }
709 llvm_unreachable("Unknown Apply Action");
710}
711#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
712#define GIMT_Encode2(Val) uint8_t(Val), uint8_t((Val) >> 8)
713#define GIMT_Encode4(Val) uint8_t(Val), uint8_t((Val) >> 8), uint8_t((Val) >> 16), uint8_t((Val) >> 24)
714#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)
715#else
716#define GIMT_Encode2(Val) uint8_t((Val) >> 8), uint8_t(Val)
717#define GIMT_Encode4(Val) uint8_t((Val) >> 24), uint8_t((Val) >> 16), uint8_t((Val) >> 8), uint8_t(Val)
718#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)
719#endif
720const uint8_t *AArch64PostLegalizerLoweringImpl::getMatchTable() const {
721 constexpr static uint8_t MatchTable0[] = {
722 /* 0 */ GIM_SwitchOpcode, /*MI*/0, /*[*/GIMT_Encode2(57), GIMT_Encode2(257), /*)*//*default:*//*Label 12*/ GIMT_Encode4(1332),
723 /* 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),
724 /* 102 */ /*TargetOpcode::G_UNMERGE_VALUES*//*Label 1*/ GIMT_Encode4(822), GIMT_Encode4(0), GIMT_Encode4(0),
725 /* 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),
726 /* 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),
727 /* 394 */ /*TargetOpcode::G_SEXT_INREG*//*Label 4*/ GIMT_Encode4(1030), GIMT_Encode4(0), GIMT_Encode4(0),
728 /* 406 */ /*TargetOpcode::G_LSHR*//*Label 5*/ GIMT_Encode4(1042),
729 /* 410 */ /*TargetOpcode::G_ASHR*//*Label 6*/ GIMT_Encode4(1054), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
730 /* 430 */ /*TargetOpcode::G_ICMP*//*Label 7*/ GIMT_Encode4(1066),
731 /* 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),
732 /* 794 */ /*TargetOpcode::G_EXTRACT_SUBVECTOR*//*Label 9*/ GIMT_Encode4(1101),
733 /* 798 */ /*TargetOpcode::G_INSERT_VECTOR_ELT*//*Label 10*/ GIMT_Encode4(1210), GIMT_Encode4(0),
734 /* 806 */ /*TargetOpcode::G_SHUFFLE_VECTOR*//*Label 11*/ GIMT_Encode4(1222),
735 /* 810 */ // Label 0: @810
736 /* 810 */ GIM_Try, /*On fail goto*//*Label 13*/ GIMT_Encode4(821), // Rule ID 19 //
737 /* 815 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule18Enabled),
738 /* 818 */ // MIs[0] dst
739 /* 818 */ // No operand predicates
740 /* 818 */ // MIs[0] src1
741 /* 818 */ // No operand predicates
742 /* 818 */ // MIs[0] src2
743 /* 818 */ // No operand predicates
744 /* 818 */ // Combiner Rule #18: lower_mulv2s64
745 /* 818 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner18),
746 /* 821 */ // Label 13: @821
747 /* 821 */ GIM_Reject,
748 /* 822 */ // Label 1: @822
749 /* 822 */ GIM_Try, /*On fail goto*//*Label 14*/ GIMT_Encode4(833), // Rule ID 18 //
750 /* 827 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule17Enabled),
751 /* 830 */ // Combiner Rule #17: unmerge_ext_to_unmerge; wip_match_opcode 'G_UNMERGE_VALUES'
752 /* 830 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner17),
753 /* 833 */ // Label 14: @833
754 /* 833 */ GIM_Try, /*On fail goto*//*Label 15*/ GIMT_Encode4(844), // Rule ID 20 //
755 /* 838 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule19Enabled),
756 /* 841 */ // Combiner Rule #19: vector_unmerge_lowering; wip_match_opcode 'G_UNMERGE_VALUES'
757 /* 841 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner19),
758 /* 844 */ // Label 15: @844
759 /* 844 */ GIM_Try, /*On fail goto*//*Label 16*/ GIMT_Encode4(991),
760 /* 849 */ GIM_CheckNumOperands, /*MI*/0, /*Expected*/3,
761 /* 852 */ GIM_Try, /*On fail goto*//*Label 17*/ GIMT_Encode4(898), // Rule ID 23 //
762 /* 857 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule22Enabled),
763 /* 860 */ // MIs[0] d1
764 /* 860 */ // No operand predicates
765 /* 860 */ // MIs[0] d2
766 /* 860 */ // No operand predicates
767 /* 860 */ // MIs[0] a
768 /* 860 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1]
769 /* 864 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(AArch64::G_DUPLANE16),
770 /* 868 */ // MIs[1] src
771 /* 868 */ // No operand predicates
772 /* 868 */ // MIs[1] c
773 /* 868 */ // No operand predicates
774 /* 868 */ GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner0),
775 /* 872 */ GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/1, /*NewInsnId*/0, /*NewOpIdx*/0,
776 /* 877 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
777 /* 879 */ // Combiner Rule #22: unmerge_duplane16
778 /* 879 */ GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(AArch64::G_DUPLANE16),
779 /* 882 */ GIR_RootToRootCopy, /*OpIdx*/0, // d1
780 /* 884 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src
781 /* 888 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/2, // c
782 /* 892 */ GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/1, /*NewInsnId*/0, /*NewOpIdx*/0,
783 /* 897 */ GIR_EraseRootFromParent_Done,
784 /* 898 */ // Label 17: @898
785 /* 898 */ GIM_Try, /*On fail goto*//*Label 18*/ GIMT_Encode4(944), // Rule ID 24 //
786 /* 903 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule23Enabled),
787 /* 906 */ // MIs[0] d1
788 /* 906 */ // No operand predicates
789 /* 906 */ // MIs[0] d2
790 /* 906 */ // No operand predicates
791 /* 906 */ // MIs[0] a
792 /* 906 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1]
793 /* 910 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(AArch64::G_DUPLANE32),
794 /* 914 */ // MIs[1] src
795 /* 914 */ // No operand predicates
796 /* 914 */ // MIs[1] c
797 /* 914 */ // No operand predicates
798 /* 914 */ GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner0),
799 /* 918 */ GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/1, /*NewInsnId*/0, /*NewOpIdx*/0,
800 /* 923 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
801 /* 925 */ // Combiner Rule #23: unmerge_duplane32
802 /* 925 */ GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(AArch64::G_DUPLANE32),
803 /* 928 */ GIR_RootToRootCopy, /*OpIdx*/0, // d1
804 /* 930 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src
805 /* 934 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/2, // c
806 /* 938 */ GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/1, /*NewInsnId*/0, /*NewOpIdx*/0,
807 /* 943 */ GIR_EraseRootFromParent_Done,
808 /* 944 */ // Label 18: @944
809 /* 944 */ GIM_Try, /*On fail goto*//*Label 19*/ GIMT_Encode4(990), // Rule ID 22 //
810 /* 949 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule21Enabled),
811 /* 952 */ // MIs[0] d1
812 /* 952 */ // No operand predicates
813 /* 952 */ // MIs[0] d2
814 /* 952 */ // No operand predicates
815 /* 952 */ // MIs[0] a
816 /* 952 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1]
817 /* 956 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(AArch64::G_DUPLANE8),
818 /* 960 */ // MIs[1] src
819 /* 960 */ // No operand predicates
820 /* 960 */ // MIs[1] c
821 /* 960 */ // No operand predicates
822 /* 960 */ GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner0),
823 /* 964 */ GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/1, /*NewInsnId*/0, /*NewOpIdx*/0,
824 /* 969 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
825 /* 971 */ // Combiner Rule #21: unmerge_duplane8
826 /* 971 */ GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(AArch64::G_DUPLANE8),
827 /* 974 */ GIR_RootToRootCopy, /*OpIdx*/0, // d1
828 /* 976 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src
829 /* 980 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/2, // c
830 /* 984 */ GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/1, /*NewInsnId*/0, /*NewOpIdx*/0,
831 /* 989 */ GIR_EraseRootFromParent_Done,
832 /* 990 */ // Label 19: @990
833 /* 990 */ GIM_Reject,
834 /* 991 */ // Label 16: @991
835 /* 991 */ GIM_Reject,
836 /* 992 */ // Label 2: @992
837 /* 992 */ GIM_Try, /*On fail goto*//*Label 20*/ GIMT_Encode4(1003), // Rule ID 13 //
838 /* 997 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule12Enabled),
839 /* 1000 */ // Combiner Rule #12: build_vector_to_dup; wip_match_opcode 'G_BUILD_VECTOR'
840 /* 1000 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner12),
841 /* 1003 */ // Label 20: @1003
842 /* 1003 */ GIM_Try, /*On fail goto*//*Label 21*/ GIMT_Encode4(1017), // Rule ID 14 //
843 /* 1008 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule13Enabled),
844 /* 1011 */ GIM_CheckNumOperandsGE, /*MI*/0, /*Expected*/2,
845 /* 1014 */ // MIs[0] dst
846 /* 1014 */ // No operand predicates
847 /* 1014 */ // MIs[0] unused
848 /* 1014 */ // No operand predicates
849 /* 1014 */ // Combiner Rule #13: build_vector_to_vector_insert
850 /* 1014 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner13),
851 /* 1017 */ // Label 21: @1017
852 /* 1017 */ GIM_Reject,
853 /* 1018 */ // Label 3: @1018
854 /* 1018 */ GIM_Try, /*On fail goto*//*Label 22*/ GIMT_Encode4(1029), // Rule ID 16 //
855 /* 1023 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule15Enabled),
856 /* 1026 */ // MIs[0] src
857 /* 1026 */ // No operand predicates
858 /* 1026 */ // MIs[0] addr
859 /* 1026 */ // No operand predicates
860 /* 1026 */ // Combiner Rule #15: form_truncstore
861 /* 1026 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner15),
862 /* 1029 */ // Label 22: @1029
863 /* 1029 */ GIM_Reject,
864 /* 1030 */ // Label 4: @1030
865 /* 1030 */ GIM_Try, /*On fail goto*//*Label 23*/ GIMT_Encode4(1041), // Rule ID 17 //
866 /* 1035 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule16Enabled),
867 /* 1038 */ // Combiner Rule #16: vector_sext_inreg_to_shift; wip_match_opcode 'G_SEXT_INREG'
868 /* 1038 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner16),
869 /* 1041 */ // Label 23: @1041
870 /* 1041 */ GIM_Reject,
871 /* 1042 */ // Label 5: @1042
872 /* 1042 */ GIM_Try, /*On fail goto*//*Label 24*/ GIMT_Encode4(1053), // Rule ID 10 //
873 /* 1047 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule9Enabled),
874 /* 1050 */ // Combiner Rule #9: vashr_vlshr_imm; wip_match_opcode 'G_LSHR'
875 /* 1050 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner9),
876 /* 1053 */ // Label 24: @1053
877 /* 1053 */ GIM_Reject,
878 /* 1054 */ // Label 6: @1054
879 /* 1054 */ GIM_Try, /*On fail goto*//*Label 25*/ GIMT_Encode4(1065), // Rule ID 9 //
880 /* 1059 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule9Enabled),
881 /* 1062 */ // Combiner Rule #9: vashr_vlshr_imm; wip_match_opcode 'G_ASHR'
882 /* 1062 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner9),
883 /* 1065 */ // Label 25: @1065
884 /* 1065 */ GIM_Reject,
885 /* 1066 */ // Label 7: @1066
886 /* 1066 */ GIM_Try, /*On fail goto*//*Label 26*/ GIMT_Encode4(1077), // Rule ID 11 //
887 /* 1071 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule10Enabled),
888 /* 1074 */ // MIs[0] dst
889 /* 1074 */ // No operand predicates
890 /* 1074 */ // MIs[0] tst
891 /* 1074 */ // No operand predicates
892 /* 1074 */ // MIs[0] src1
893 /* 1074 */ // No operand predicates
894 /* 1074 */ // MIs[0] src2
895 /* 1074 */ // No operand predicates
896 /* 1074 */ // Combiner Rule #10: adjust_icmp_imm
897 /* 1074 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner10),
898 /* 1077 */ // Label 26: @1077
899 /* 1077 */ GIM_Try, /*On fail goto*//*Label 27*/ GIMT_Encode4(1088), // Rule ID 12 //
900 /* 1082 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule11Enabled),
901 /* 1085 */ // MIs[0] dst
902 /* 1085 */ // No operand predicates
903 /* 1085 */ // MIs[0] tst
904 /* 1085 */ // No operand predicates
905 /* 1085 */ // MIs[0] src1
906 /* 1085 */ // No operand predicates
907 /* 1085 */ // MIs[0] src2
908 /* 1085 */ // No operand predicates
909 /* 1085 */ // Combiner Rule #11: swap_icmp_operands
910 /* 1085 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner11),
911 /* 1088 */ // Label 27: @1088
912 /* 1088 */ GIM_Reject,
913 /* 1089 */ // Label 8: @1089
914 /* 1089 */ GIM_Try, /*On fail goto*//*Label 28*/ GIMT_Encode4(1100), // Rule ID 15 //
915 /* 1094 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule14Enabled),
916 /* 1097 */ // MIs[0] dst
917 /* 1097 */ // No operand predicates
918 /* 1097 */ // MIs[0] tst
919 /* 1097 */ // No operand predicates
920 /* 1097 */ // MIs[0] src1
921 /* 1097 */ // No operand predicates
922 /* 1097 */ // MIs[0] src2
923 /* 1097 */ // No operand predicates
924 /* 1097 */ // Combiner Rule #14: lower_vector_fcmp
925 /* 1097 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner14),
926 /* 1100 */ // Label 28: @1100
927 /* 1100 */ GIM_Reject,
928 /* 1101 */ // Label 9: @1101
929 /* 1101 */ GIM_Try, /*On fail goto*//*Label 29*/ GIMT_Encode4(1137), // Rule ID 26 //
930 /* 1106 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule25Enabled),
931 /* 1109 */ // MIs[0] d1
932 /* 1109 */ // No operand predicates
933 /* 1109 */ // MIs[0] a
934 /* 1109 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
935 /* 1113 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(AArch64::G_DUPLANE16),
936 /* 1117 */ // MIs[1] src
937 /* 1117 */ // No operand predicates
938 /* 1117 */ // MIs[1] c
939 /* 1117 */ // No operand predicates
940 /* 1117 */ // MIs[0] l
941 /* 1117 */ // No operand predicates
942 /* 1117 */ GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner0),
943 /* 1121 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
944 /* 1123 */ // Combiner Rule #25: extract_duplane16
945 /* 1123 */ GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(AArch64::G_DUPLANE16),
946 /* 1126 */ GIR_RootToRootCopy, /*OpIdx*/0, // d1
947 /* 1128 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src
948 /* 1132 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/2, // c
949 /* 1136 */ GIR_EraseRootFromParent_Done,
950 /* 1137 */ // Label 29: @1137
951 /* 1137 */ GIM_Try, /*On fail goto*//*Label 30*/ GIMT_Encode4(1173), // Rule ID 27 //
952 /* 1142 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule26Enabled),
953 /* 1145 */ // MIs[0] d1
954 /* 1145 */ // No operand predicates
955 /* 1145 */ // MIs[0] a
956 /* 1145 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
957 /* 1149 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(AArch64::G_DUPLANE32),
958 /* 1153 */ // MIs[1] src
959 /* 1153 */ // No operand predicates
960 /* 1153 */ // MIs[1] c
961 /* 1153 */ // No operand predicates
962 /* 1153 */ // MIs[0] l
963 /* 1153 */ // No operand predicates
964 /* 1153 */ GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner0),
965 /* 1157 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
966 /* 1159 */ // Combiner Rule #26: extract_duplane32
967 /* 1159 */ GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(AArch64::G_DUPLANE32),
968 /* 1162 */ GIR_RootToRootCopy, /*OpIdx*/0, // d1
969 /* 1164 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src
970 /* 1168 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/2, // c
971 /* 1172 */ GIR_EraseRootFromParent_Done,
972 /* 1173 */ // Label 30: @1173
973 /* 1173 */ GIM_Try, /*On fail goto*//*Label 31*/ GIMT_Encode4(1209), // Rule ID 25 //
974 /* 1178 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule24Enabled),
975 /* 1181 */ // MIs[0] d1
976 /* 1181 */ // No operand predicates
977 /* 1181 */ // MIs[0] a
978 /* 1181 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
979 /* 1185 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(AArch64::G_DUPLANE8),
980 /* 1189 */ // MIs[1] src
981 /* 1189 */ // No operand predicates
982 /* 1189 */ // MIs[1] c
983 /* 1189 */ // No operand predicates
984 /* 1189 */ // MIs[0] l
985 /* 1189 */ // No operand predicates
986 /* 1189 */ GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner0),
987 /* 1193 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
988 /* 1195 */ // Combiner Rule #24: extract_duplane8
989 /* 1195 */ GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(AArch64::G_DUPLANE8),
990 /* 1198 */ GIR_RootToRootCopy, /*OpIdx*/0, // d1
991 /* 1200 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/1, // src
992 /* 1204 */ GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/1, /*OpIdx*/2, // c
993 /* 1208 */ GIR_EraseRootFromParent_Done,
994 /* 1209 */ // Label 31: @1209
995 /* 1209 */ GIM_Reject,
996 /* 1210 */ // Label 10: @1210
997 /* 1210 */ GIM_Try, /*On fail goto*//*Label 32*/ GIMT_Encode4(1221), // Rule ID 21 //
998 /* 1215 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule20Enabled),
999 /* 1218 */ // Combiner Rule #20: insertelt_nonconst; wip_match_opcode 'G_INSERT_VECTOR_ELT'
1000 /* 1218 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner20),
1001 /* 1221 */ // Label 32: @1221
1002 /* 1221 */ GIM_Reject,
1003 /* 1222 */ // Label 11: @1222
1004 /* 1222 */ GIM_Try, /*On fail goto*//*Label 33*/ GIMT_Encode4(1233), // Rule ID 0 //
1005 /* 1227 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule0Enabled),
1006 /* 1230 */ // Combiner Rule #0: dup; wip_match_opcode 'G_SHUFFLE_VECTOR'
1007 /* 1230 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner0),
1008 /* 1233 */ // Label 33: @1233
1009 /* 1233 */ GIM_Try, /*On fail goto*//*Label 34*/ GIMT_Encode4(1244), // Rule ID 1 //
1010 /* 1238 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule1Enabled),
1011 /* 1241 */ // Combiner Rule #1: form_duplane; wip_match_opcode 'G_SHUFFLE_VECTOR'
1012 /* 1241 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner1),
1013 /* 1244 */ // Label 34: @1244
1014 /* 1244 */ GIM_Try, /*On fail goto*//*Label 35*/ GIMT_Encode4(1255), // Rule ID 2 //
1015 /* 1249 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule2Enabled),
1016 /* 1252 */ // Combiner Rule #2: rev; wip_match_opcode 'G_SHUFFLE_VECTOR'
1017 /* 1252 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner2),
1018 /* 1255 */ // Label 35: @1255
1019 /* 1255 */ GIM_Try, /*On fail goto*//*Label 36*/ GIMT_Encode4(1266), // Rule ID 3 //
1020 /* 1260 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule3Enabled),
1021 /* 1263 */ // Combiner Rule #3: ext; wip_match_opcode 'G_SHUFFLE_VECTOR'
1022 /* 1263 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner3),
1023 /* 1266 */ // Label 36: @1266
1024 /* 1266 */ GIM_Try, /*On fail goto*//*Label 37*/ GIMT_Encode4(1277), // Rule ID 4 //
1025 /* 1271 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule4Enabled),
1026 /* 1274 */ // Combiner Rule #4: zip; wip_match_opcode 'G_SHUFFLE_VECTOR'
1027 /* 1274 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner4),
1028 /* 1277 */ // Label 37: @1277
1029 /* 1277 */ GIM_Try, /*On fail goto*//*Label 38*/ GIMT_Encode4(1288), // Rule ID 5 //
1030 /* 1282 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule5Enabled),
1031 /* 1285 */ // Combiner Rule #5: uzp; wip_match_opcode 'G_SHUFFLE_VECTOR'
1032 /* 1285 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner5),
1033 /* 1288 */ // Label 38: @1288
1034 /* 1288 */ GIM_Try, /*On fail goto*//*Label 39*/ GIMT_Encode4(1299), // Rule ID 6 //
1035 /* 1293 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule6Enabled),
1036 /* 1296 */ // Combiner Rule #6: trn; wip_match_opcode 'G_SHUFFLE_VECTOR'
1037 /* 1296 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner6),
1038 /* 1299 */ // Label 39: @1299
1039 /* 1299 */ GIM_Try, /*On fail goto*//*Label 40*/ GIMT_Encode4(1310), // Rule ID 8 //
1040 /* 1304 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule8Enabled),
1041 /* 1307 */ // Combiner Rule #8: shuf_to_ins; wip_match_opcode 'G_SHUFFLE_VECTOR'
1042 /* 1307 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner8),
1043 /* 1310 */ // Label 40: @1310
1044 /* 1310 */ GIM_Try, /*On fail goto*//*Label 41*/ GIMT_Encode4(1331), // Rule ID 7 //
1045 /* 1315 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule7Enabled),
1046 /* 1318 */ // MIs[0] src
1047 /* 1318 */ // No operand predicates
1048 /* 1318 */ // MIs[0] src1
1049 /* 1318 */ // No operand predicates
1050 /* 1318 */ // MIs[0] src2
1051 /* 1318 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1]
1052 /* 1322 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_IMPLICIT_DEF),
1053 /* 1326 */ // MIs[0] mask
1054 /* 1326 */ // No operand predicates
1055 /* 1326 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
1056 /* 1328 */ // Combiner Rule #7: fullrev
1057 /* 1328 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner7),
1058 /* 1331 */ // Label 41: @1331
1059 /* 1331 */ GIM_Reject,
1060 /* 1332 */ // Label 12: @1332
1061 /* 1332 */ GIM_Reject,
1062 /* 1333 */ }; // Size: 1333 bytes
1063 return MatchTable0;
1064}
1065#undef GIMT_Encode2
1066#undef GIMT_Encode4
1067#undef GIMT_Encode8
1068
1069
1070#endif // GET_GICOMBINER_IMPL
1071
1072#ifdef GET_GICOMBINER_CONSTRUCTOR_INITS
1073
1074AvailableModuleFeatures(computeAvailableModuleFeatures(&STI)),
1075AvailableFunctionFeatures()
1076
1077#endif // GET_GICOMBINER_CONSTRUCTOR_INITS
1078
1079#ifdef GET_GICOMBINER_CONSTRUCTOR_INITS
1080
1081, State(0),
1082ExecInfo(TypeObjects, NumTypeObjects, FeatureBitsets, ComplexPredicateFns, CustomRenderers)
1083
1084#endif // GET_GICOMBINER_CONSTRUCTOR_INITS
1085
1086