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