1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* AArch64PostLegalizerCombinerImpl 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"
11namespace llvm {
12extern cl::OptionCategory GICombinerOptionCategory;
13} // end namespace llvm
14#endif // ifdef GET_GICOMBINER_DEPS
15
16#ifdef GET_GICOMBINER_TYPES
17struct AArch64PostLegalizerCombinerImplRuleConfig {
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
26static 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 9: // 3 strings to match.
37 switch (RuleIdentifier[0]) {
38 default: break;
39 case 'c': // 1 string to match.
40 if (memcmp(RuleIdentifier.data()+1, "opy_prop", 8) != 0)
41 break;
42 return 0; // "copy_prop"
43 case 'm': // 1 string to match.
44 if (memcmp(RuleIdentifier.data()+1, "ul_const", 8) != 0)
45 break;
46 return 11; // "mul_const"
47 case 'o': // 1 string to match.
48 if (memcmp(RuleIdentifier.data()+1, "r_to_bsp", 8) != 0)
49 break;
50 return 62; // "or_to_bsp"
51 }
52 break;
53 case 10: // 2 strings to match.
54 switch (RuleIdentifier[0]) {
55 default: break;
56 case 'i': // 1 string to match.
57 if (memcmp(RuleIdentifier.data()+1, "2p_to_p2i", 9) != 0)
58 break;
59 return 33; // "i2p_to_p2i"
60 case 'p': // 1 string to match.
61 if (memcmp(RuleIdentifier.data()+1, "2i_to_i2p", 9) != 0)
62 break;
63 return 32; // "p2i_to_i2p"
64 }
65 break;
66 case 11: // 1 string to match.
67 if (memcmp(RuleIdentifier.data()+0, "add_sub_reg", 11) != 0)
68 break;
69 return 38; // "add_sub_reg"
70 case 12: // 1 string to match.
71 if (memcmp(RuleIdentifier.data()+0, "redundant_or", 12) != 0)
72 break;
73 return 10; // "redundant_or"
74 case 13: // 5 strings to match.
75 switch (RuleIdentifier[0]) {
76 default: break;
77 case 'l': // 1 string to match.
78 if (memcmp(RuleIdentifier.data()+1, "oad_and_mask", 12) != 0)
79 break;
80 return 2; // "load_and_mask"
81 case 'm': // 2 strings to match.
82 switch (RuleIdentifier[1]) {
83 default: break;
84 case 'a': // 1 string to match.
85 if (memcmp(RuleIdentifier.data()+2, "tch_selects", 11) != 0)
86 break;
87 return 23; // "match_selects"
88 case 'e': // 1 string to match.
89 if (memcmp(RuleIdentifier.data()+2, "rge_unmerge", 11) != 0)
90 break;
91 return 19; // "merge_unmerge"
92 }
93 break;
94 case 'r': // 1 string to match.
95 if (memcmp(RuleIdentifier.data()+1, "edundant_and", 12) != 0)
96 break;
97 return 7; // "redundant_and"
98 case 'u': // 1 string to match.
99 if (memcmp(RuleIdentifier.data()+1, "nmerge_undef", 12) != 0)
100 break;
101 return 59; // "unmerge_undef"
102 }
103 break;
104 case 14: // 2 strings to match.
105 switch (RuleIdentifier[0]) {
106 default: break;
107 case 'b': // 1 string to match.
108 if (memcmp(RuleIdentifier.data()+1, "inop_same_val", 13) != 0)
109 break;
110 return 29; // "binop_same_val"
111 case 'f': // 1 string to match.
112 if (memcmp(RuleIdentifier.data()+1, "neg_fneg_fold", 13) != 0)
113 break;
114 return 35; // "fneg_fneg_fold"
115 }
116 break;
117 case 15: // 3 strings to match.
118 switch (RuleIdentifier[0]) {
119 default: break;
120 case 'e': // 1 string to match.
121 if (memcmp(RuleIdentifier.data()+1, "xtending_loads", 14) != 0)
122 break;
123 return 1; // "extending_loads"
124 case 'o': // 1 string to match.
125 if (memcmp(RuleIdentifier.data()+1, "verlapping_and", 14) != 0)
126 break;
127 return 47; // "overlapping_and"
128 case 's': // 1 string to match.
129 if (memcmp(RuleIdentifier.data()+1, "elect_same_val", 14) != 0)
130 break;
131 return 27; // "select_same_val"
132 }
133 break;
134 case 16: // 4 strings to match.
135 switch (RuleIdentifier[0]) {
136 default: break;
137 case 'c': // 1 string to match.
138 if (memcmp(RuleIdentifier.data()+1, "ombine_mul_cmlt", 15) != 0)
139 break;
140 return 67; // "combine_mul_cmlt"
141 case 's': // 2 strings to match.
142 if (memcmp(RuleIdentifier.data()+1, "elect_", 6) != 0)
143 break;
144 switch (RuleIdentifier[7]) {
145 default: break;
146 case 't': // 1 string to match.
147 if (memcmp(RuleIdentifier.data()+8, "o_minmax", 8) != 0)
148 break;
149 return 61; // "select_to_minmax"
150 case 'u': // 1 string to match.
151 if (memcmp(RuleIdentifier.data()+8, "ndef_cmp", 8) != 0)
152 break;
153 return 20; // "select_undef_cmp"
154 }
155 break;
156 case 'u': // 1 string to match.
157 if (memcmp(RuleIdentifier.data()+1, "ndef_to_fp_zero", 15) != 0)
158 break;
159 return 49; // "undef_to_fp_zero"
160 }
161 break;
162 case 17: // 4 strings to match.
163 switch (RuleIdentifier[0]) {
164 default: break;
165 case 'a': // 1 string to match.
166 if (memcmp(RuleIdentifier.data()+1, "nyext_trunc_fold", 16) != 0)
167 break;
168 return 34; // "anyext_trunc_fold"
169 case 'e': // 1 string to match.
170 if (memcmp(RuleIdentifier.data()+1, "rase_undef_store", 16) != 0)
171 break;
172 return 58; // "erase_undef_store"
173 case 's': // 1 string to match.
174 if (memcmp(RuleIdentifier.data()+1, "elect_to_iminmax", 16) != 0)
175 break;
176 return 22; // "select_to_iminmax"
177 case 'u': // 1 string to match.
178 if (memcmp(RuleIdentifier.data()+1, "ndef_to_int_zero", 16) != 0)
179 break;
180 return 50; // "undef_to_int_zero"
181 }
182 break;
183 case 18: // 3 strings to match.
184 switch (RuleIdentifier[0]) {
185 default: break;
186 case 'b': // 1 string to match.
187 if (memcmp(RuleIdentifier.data()+1, "inop_left_to_zero", 17) != 0)
188 break;
189 return 30; // "binop_left_to_zero"
190 case 'f': // 2 strings to match.
191 switch (RuleIdentifier[1]) {
192 default: break;
193 case 'o': // 1 string to match.
194 if (memcmp(RuleIdentifier.data()+2, "ld_merge_to_zext", 16) != 0)
195 break;
196 return 24; // "fold_merge_to_zext"
197 case 'p': // 1 string to match.
198 if (memcmp(RuleIdentifier.data()+2, "trunc_fpext_fold", 16) != 0)
199 break;
200 return 43; // "fptrunc_fpext_fold"
201 }
202 break;
203 }
204 break;
205 case 19: // 8 strings to match.
206 switch (RuleIdentifier[0]) {
207 default: break;
208 case 'b': // 1 string to match.
209 if (memcmp(RuleIdentifier.data()+1, "inop_right_to_zero", 18) != 0)
210 break;
211 return 31; // "binop_right_to_zero"
212 case 'c': // 1 string to match.
213 if (memcmp(RuleIdentifier.data()+1, "onstant_fold_binop", 18) != 0)
214 break;
215 return 25; // "constant_fold_binop"
216 case 'p': // 1 string to match.
217 if (memcmp(RuleIdentifier.data()+1, "tr_add_immed_chain", 18) != 0)
218 break;
219 return 46; // "ptr_add_immed_chain"
220 case 'r': // 2 strings to match.
221 switch (RuleIdentifier[1]) {
222 default: break;
223 case 'i': // 1 string to match.
224 if (memcmp(RuleIdentifier.data()+2, "ght_identity_zero", 17) != 0)
225 break;
226 return 28; // "right_identity_zero"
227 case 'o': // 1 string to match.
228 if (memcmp(RuleIdentifier.data()+2, "tate_out_of_range", 17) != 0)
229 break;
230 return 17; // "rotate_out_of_range"
231 }
232 break;
233 case 's': // 2 strings to match.
234 if (RuleIdentifier[1] != 'e')
235 break;
236 switch (RuleIdentifier[2]) {
237 default: break;
238 case 'l': // 1 string to match.
239 if (memcmp(RuleIdentifier.data()+3, "ect_constant_cmp", 16) != 0)
240 break;
241 return 21; // "select_constant_cmp"
242 case 'x': // 1 string to match.
243 if (memcmp(RuleIdentifier.data()+3, "t_trunc_sextload", 16) != 0)
244 break;
245 return 4; // "sext_trunc_sextload"
246 }
247 break;
248 case 'u': // 1 string to match.
249 if (memcmp(RuleIdentifier.data()+1, "nary_undef_to_zero", 18) != 0)
250 break;
251 return 54; // "unary_undef_to_zero"
252 }
253 break;
254 case 20: // 3 strings to match.
255 switch (RuleIdentifier[0]) {
256 default: break;
257 case 'b': // 1 string to match.
258 if (memcmp(RuleIdentifier.data()+1, "itcast_bitcast_fold", 19) != 0)
259 break;
260 return 42; // "bitcast_bitcast_fold"
261 case 'r': // 1 string to match.
262 if (memcmp(RuleIdentifier.data()+1, "edundant_sext_inreg", 19) != 0)
263 break;
264 return 12; // "redundant_sext_inreg"
265 case 's': // 1 string to match.
266 if (memcmp(RuleIdentifier.data()+1, "plit_store_zero_128", 19) != 0)
267 break;
268 return 48; // "split_store_zero_128"
269 }
270 break;
271 case 21: // 4 strings to match.
272 switch (RuleIdentifier[0]) {
273 default: break;
274 case 'c': // 1 string to match.
275 if (memcmp(RuleIdentifier.data()+1, "ombine_concat_vector", 20) != 0)
276 break;
277 return 63; // "combine_concat_vector"
278 case 'm': // 1 string to match.
279 if (memcmp(RuleIdentifier.data()+1, "utate_anyext_to_zext", 20) != 0)
280 break;
281 return 5; // "mutate_anyext_to_zext"
282 case 'r': // 1 string to match.
283 if (memcmp(RuleIdentifier.data()+1, "ight_identity_one_fp", 20) != 0)
284 break;
285 return 37; // "right_identity_one_fp"
286 case 'u': // 1 string to match.
287 if (memcmp(RuleIdentifier.data()+1, "ndef_to_negative_one", 20) != 0)
288 break;
289 return 51; // "undef_to_negative_one"
290 }
291 break;
292 case 22: // 4 strings to match.
293 switch (RuleIdentifier[0]) {
294 default: break;
295 case 'c': // 1 string to match.
296 if (memcmp(RuleIdentifier.data()+1, "onstant_fold_fp_binop", 21) != 0)
297 break;
298 return 26; // "constant_fold_fp_binop"
299 case 'p': // 1 string to match.
300 if (memcmp(RuleIdentifier.data()+1, "ropagate_undef_any_op", 21) != 0)
301 break;
302 return 55; // "propagate_undef_any_op"
303 case 'r': // 1 string to match.
304 if (memcmp(RuleIdentifier.data()+1, "ight_identity_one_int", 21) != 0)
305 break;
306 return 36; // "right_identity_one_int"
307 case 't': // 1 string to match.
308 if (memcmp(RuleIdentifier.data()+1, "runc_buildvector_fold", 21) != 0)
309 break;
310 return 40; // "trunc_buildvector_fold"
311 }
312 break;
313 case 23: // 1 string to match.
314 if (memcmp(RuleIdentifier.data()+0, "propagate_undef_all_ops", 23) != 0)
315 break;
316 return 56; // "propagate_undef_all_ops"
317 case 24: // 2 strings to match.
318 switch (RuleIdentifier[0]) {
319 default: break;
320 case 'b': // 1 string to match.
321 if (memcmp(RuleIdentifier.data()+1, "inop_left_undef_to_zero", 23) != 0)
322 break;
323 return 52; // "binop_left_undef_to_zero"
324 case 'x': // 1 string to match.
325 if (memcmp(RuleIdentifier.data()+1, "or_of_and_with_same_reg", 23) != 0)
326 break;
327 return 8; // "xor_of_and_with_same_reg"
328 }
329 break;
330 case 25: // 4 strings to match.
331 switch (RuleIdentifier[0]) {
332 default: break;
333 case 'b': // 3 strings to match.
334 switch (RuleIdentifier[1]) {
335 default: break;
336 case 'i': // 2 strings to match.
337 if (memcmp(RuleIdentifier.data()+2, "tfield_extract_from_", 20) != 0)
338 break;
339 switch (RuleIdentifier[22]) {
340 default: break;
341 case 'a': // 1 string to match.
342 if (memcmp(RuleIdentifier.data()+23, "nd", 2) != 0)
343 break;
344 return 14; // "bitfield_extract_from_and"
345 case 's': // 1 string to match.
346 if (memcmp(RuleIdentifier.data()+23, "hr", 2) != 0)
347 break;
348 return 15; // "bitfield_extract_from_shr"
349 }
350 break;
351 case 'u': // 1 string to match.
352 if (memcmp(RuleIdentifier.data()+2, "ildvector_identity_fold", 23) != 0)
353 break;
354 return 39; // "buildvector_identity_fold"
355 }
356 break;
357 case 'r': // 1 string to match.
358 if (memcmp(RuleIdentifier.data()+1, "ight_identity_neg_one_fp", 24) != 0)
359 break;
360 return 45; // "right_identity_neg_one_fp"
361 }
362 break;
363 case 26: // 5 strings to match.
364 switch (RuleIdentifier[0]) {
365 default: break;
366 case 'b': // 1 string to match.
367 if (memcmp(RuleIdentifier.data()+1, "inop_right_undef_to_undef", 25) != 0)
368 break;
369 return 53; // "binop_right_undef_to_undef"
370 case 'c': // 2 strings to match.
371 if (memcmp(RuleIdentifier.data()+1, "om", 2) != 0)
372 break;
373 switch (RuleIdentifier[3]) {
374 default: break;
375 case 'b': // 1 string to match.
376 if (memcmp(RuleIdentifier.data()+4, "ine_indexed_load_store", 22) != 0)
377 break;
378 return 3; // "combine_indexed_load_store"
379 case 'm': // 1 string to match.
380 if (memcmp(RuleIdentifier.data()+4, "ute_fp_constant_to_rhs", 22) != 0)
381 break;
382 return 65; // "commute_fp_constant_to_rhs"
383 }
384 break;
385 case 'e': // 1 string to match.
386 if (memcmp(RuleIdentifier.data()+1, "xtractvecelt_pairwise_add", 25) != 0)
387 break;
388 return 9; // "extractvecelt_pairwise_add"
389 case 'r': // 1 string to match.
390 if (memcmp(RuleIdentifier.data()+1, "ight_identity_neg_zero_fp", 25) != 0)
391 break;
392 return 44; // "right_identity_neg_zero_fp"
393 }
394 break;
395 case 27: // 2 strings to match.
396 switch (RuleIdentifier[0]) {
397 default: break;
398 case 'c': // 1 string to match.
399 if (memcmp(RuleIdentifier.data()+1, "ommute_int_constant_to_rhs", 26) != 0)
400 break;
401 return 64; // "commute_int_constant_to_rhs"
402 case 't': // 1 string to match.
403 if (memcmp(RuleIdentifier.data()+1, "runc_lshr_buildvector_fold", 26) != 0)
404 break;
405 return 41; // "trunc_lshr_buildvector_fold"
406 }
407 break;
408 case 28: // 1 string to match.
409 if (memcmp(RuleIdentifier.data()+0, "propagate_undef_shuffle_mask", 28) != 0)
410 break;
411 return 57; // "propagate_undef_shuffle_mask"
412 case 29: // 2 strings to match.
413 switch (RuleIdentifier[0]) {
414 default: break;
415 case 'b': // 1 string to match.
416 if (memcmp(RuleIdentifier.data()+1, "itfield_extract_from_shr_and", 28) != 0)
417 break;
418 return 16; // "bitfield_extract_from_shr_and"
419 case 'i': // 1 string to match.
420 if (memcmp(RuleIdentifier.data()+1, "cmp_to_true_false_known_bits", 28) != 0)
421 break;
422 return 18; // "icmp_to_true_false_known_bits"
423 }
424 break;
425 case 32: // 1 string to match.
426 if (memcmp(RuleIdentifier.data()+0, "bitfield_extract_from_sext_inreg", 32) != 0)
427 break;
428 return 13; // "bitfield_extract_from_sext_inreg"
429 case 36: // 1 string to match.
430 if (memcmp(RuleIdentifier.data()+0, "insert_extract_vec_elt_out_of_bounds", 36) != 0)
431 break;
432 return 60; // "insert_extract_vec_elt_out_of_bounds"
433 case 37: // 1 string to match.
434 if (memcmp(RuleIdentifier.data()+0, "hoist_logic_op_with_same_opcode_hands", 37) != 0)
435 break;
436 return 6; // "hoist_logic_op_with_same_opcode_hands"
437 case 46: // 1 string to match.
438 if (memcmp(RuleIdentifier.data()+0, "push_freeze_to_prevent_poison_from_propagating", 46) != 0)
439 break;
440 return 66; // "push_freeze_to_prevent_poison_from_propagating"
441 }
442#endif // ifndef NDEBUG
443
444 return std::nullopt;
445}
446static std::optional<std::pair<uint64_t, uint64_t>> getRuleRangeForIdentifier(StringRef RuleIdentifier) {
447 std::pair<StringRef, StringRef> RangePair = RuleIdentifier.split('-');
448 if (!RangePair.second.empty()) {
449 const auto First = getRuleIdxForIdentifier(RangePair.first);
450 const auto Last = getRuleIdxForIdentifier(RangePair.second);
451 if (!First || !Last)
452 return std::nullopt;
453 if (First >= Last)
454 report_fatal_error("Beginning of range should be before end of range");
455 return {{*First, *Last + 1}};
456 }
457 if (RangePair.first == "*") {
458 return {{0, 68}};
459 }
460 const auto I = getRuleIdxForIdentifier(RangePair.first);
461 if (!I)
462 return std::nullopt;
463 return {{*I, *I + 1}};
464}
465
466bool AArch64PostLegalizerCombinerImplRuleConfig::setRuleEnabled(StringRef RuleIdentifier) {
467 auto MaybeRange = getRuleRangeForIdentifier(RuleIdentifier);
468 if (!MaybeRange)
469 return false;
470 for (auto I = MaybeRange->first; I < MaybeRange->second; ++I)
471 DisabledRules.reset(I);
472 return true;
473}
474
475bool AArch64PostLegalizerCombinerImplRuleConfig::setRuleDisabled(StringRef RuleIdentifier) {
476 auto MaybeRange = getRuleRangeForIdentifier(RuleIdentifier);
477 if (!MaybeRange)
478 return false;
479 for (auto I = MaybeRange->first; I < MaybeRange->second; ++I)
480 DisabledRules.set(I);
481 return true;
482}
483
484static std::vector<std::string> AArch64PostLegalizerCombinerOption;
485static cl::list<std::string> AArch64PostLegalizerCombinerDisableOption(
486 "aarch64postlegalizercombiner-disable-rule",
487 cl::desc("Disable one or more combiner rules temporarily in the AArch64PostLegalizerCombiner pass"),
488 cl::CommaSeparated,
489 cl::Hidden,
490 cl::cat(GICombinerOptionCategory),
491 cl::callback([](const std::string &Str) {
492 AArch64PostLegalizerCombinerOption.push_back(Str);
493 }));
494static cl::list<std::string> AArch64PostLegalizerCombinerOnlyEnableOption(
495 "aarch64postlegalizercombiner-only-enable-rule",
496 cl::desc("Disable all rules in the AArch64PostLegalizerCombiner pass then re-enable the specified ones"),
497 cl::Hidden,
498 cl::cat(GICombinerOptionCategory),
499 cl::callback([](const std::string &CommaSeparatedArg) {
500 StringRef Str = CommaSeparatedArg;
501 AArch64PostLegalizerCombinerOption.push_back("*");
502 do {
503 auto X = Str.split(",");
504 AArch64PostLegalizerCombinerOption.push_back(("!" + X.first).str());
505 Str = X.second;
506 } while (!Str.empty());
507 }));
508
509
510bool AArch64PostLegalizerCombinerImplRuleConfig::isRuleEnabled(unsigned RuleID) const {
511 return !DisabledRules.test(RuleID);
512}
513bool AArch64PostLegalizerCombinerImplRuleConfig::parseCommandLineOption() {
514 for (StringRef Identifier : AArch64PostLegalizerCombinerOption) {
515 bool Enabled = Identifier.consume_front("!");
516 if (Enabled && !setRuleEnabled(Identifier))
517 return false;
518 if (!Enabled && !setRuleDisabled(Identifier))
519 return false;
520 }
521 return true;
522}
523
524#endif // ifdef GET_GICOMBINER_TYPES
525
526#ifdef GET_GICOMBINER_TYPES
527const unsigned MAX_SUBTARGET_PREDICATES = 0;
528using PredicateBitset = llvm::Bitset<MAX_SUBTARGET_PREDICATES>;
529#endif // ifdef GET_GICOMBINER_TYPES
530
531#ifdef GET_GICOMBINER_CLASS_MEMBERS
532PredicateBitset AvailableModuleFeatures;
533mutable PredicateBitset AvailableFunctionFeatures;
534PredicateBitset getAvailableFeatures() const {
535 return AvailableModuleFeatures | AvailableFunctionFeatures;
536}
537PredicateBitset
538computeAvailableModuleFeatures(const AArch64Subtarget *Subtarget) const;
539PredicateBitset
540computeAvailableFunctionFeatures(const AArch64Subtarget *Subtarget,
541 const MachineFunction *MF) const;
542void setupGeneratedPerFunctionState(MachineFunction &MF) override;
543#endif // ifdef GET_GICOMBINER_CLASS_MEMBERS
544#ifdef GET_GICOMBINER_CLASS_MEMBERS
545 mutable MatcherState State;
546 typedef ComplexRendererFns(AArch64PostLegalizerCombinerImpl::*ComplexMatcherMemFn)(MachineOperand &) const;
547 typedef void(AArch64PostLegalizerCombinerImpl::*CustomRendererFn)(MachineInstrBuilder &, const MachineInstr &, int) const;
548 const ExecInfoTy<PredicateBitset, ComplexMatcherMemFn, CustomRendererFn> ExecInfo;
549 static AArch64PostLegalizerCombinerImpl::ComplexMatcherMemFn ComplexPredicateFns[];
550 static AArch64PostLegalizerCombinerImpl::CustomRendererFn CustomRenderers[];
551 bool testImmPredicate_I64(unsigned PredicateID, int64_t Imm) const override;
552 bool testImmPredicate_APInt(unsigned PredicateID, const APInt &Imm) const override;
553 bool testImmPredicate_APFloat(unsigned PredicateID, const APFloat &Imm) const override;
554 const uint8_t *getMatchTable() const override;
555 bool testMIPredicate_MI(unsigned PredicateID, const MachineInstr &MI, const MatcherState &State) const override;
556 bool testSimplePredicate(unsigned PredicateID) const override;
557 bool runCustomAction(unsigned FnID, const MatcherState &State, NewMIVector &OutMIs) const override;
558#endif // ifdef GET_GICOMBINER_CLASS_MEMBERS
559
560#ifdef GET_GICOMBINER_IMPL
561// LLT Objects.
562enum {
563 GILLT_s1,
564};
565const static size_t NumTypeObjects = 1;
566const static LLT TypeObjects[] = {
567 LLT::scalar(1),
568};
569
570// Bits for subtarget features that participate in instruction matching.
571enum SubtargetFeatureBits : uint8_t {
572};
573
574PredicateBitset AArch64PostLegalizerCombinerImpl::
575computeAvailableModuleFeatures(const AArch64Subtarget *Subtarget) const {
576 PredicateBitset Features{};
577 return Features;
578}
579
580void AArch64PostLegalizerCombinerImpl::setupGeneratedPerFunctionState(MachineFunction &MF) {
581 AvailableFunctionFeatures = computeAvailableFunctionFeatures((const AArch64Subtarget *)&MF.getSubtarget(), &MF);
582}
583PredicateBitset AArch64PostLegalizerCombinerImpl::
584computeAvailableFunctionFeatures(const AArch64Subtarget *Subtarget, const MachineFunction *MF) const {
585 PredicateBitset Features{};
586 return Features;
587}
588
589// Feature bitsets.
590enum {
591 GIFBS_Invalid,
592};
593constexpr static PredicateBitset FeatureBitsets[] {
594 {}, // GIFBS_Invalid
595};
596
597// ComplexPattern predicates.
598enum {
599 GICP_Invalid,
600};
601// See constructor for table contents
602
603AArch64PostLegalizerCombinerImpl::ComplexMatcherMemFn
604AArch64PostLegalizerCombinerImpl::ComplexPredicateFns[] = {
605 nullptr, // GICP_Invalid
606};
607
608enum {
609 GICXXPred_MI_Predicate_GICombiner0 = GICXXPred_Invalid + 1,
610 GICXXPred_MI_Predicate_GICombiner1,
611 GICXXPred_MI_Predicate_GICombiner2,
612};
613bool AArch64PostLegalizerCombinerImpl::testMIPredicate_MI(unsigned PredicateID, const MachineInstr & MI, const MatcherState &State) const {
614 switch (PredicateID) {
615 case GICXXPred_MI_Predicate_GICombiner0: {
616 return Helper.matchConstantFPOp(State.MIs[0]->getOperand(2), 1.0);
617 }
618 case GICXXPred_MI_Predicate_GICombiner1: {
619 return Helper.matchConstantFPOp(State.MIs[0]->getOperand(2), -0.0);
620 }
621 case GICXXPred_MI_Predicate_GICombiner2: {
622 return Helper.matchConstantFPOp(State.MIs[0]->getOperand(2), -1.0);
623 }
624 }
625 llvm_unreachable("Unknown predicate");
626 return false;
627}
628bool AArch64PostLegalizerCombinerImpl::testImmPredicate_I64(unsigned PredicateID, int64_t Imm) const {
629 llvm_unreachable("Unknown predicate");
630 return false;
631}
632bool AArch64PostLegalizerCombinerImpl::testImmPredicate_APFloat(unsigned PredicateID, const APFloat & Imm) const {
633 llvm_unreachable("Unknown predicate");
634 return false;
635}
636bool AArch64PostLegalizerCombinerImpl::testImmPredicate_APInt(unsigned PredicateID, const APInt & Imm) const {
637 llvm_unreachable("Unknown predicate");
638 return false;
639}
640enum {
641 GICXXPred_Simple_IsRule0Enabled = GICXXPred_Invalid + 1,
642 GICXXPred_Simple_IsRule1Enabled,
643 GICXXPred_Simple_IsRule2Enabled,
644 GICXXPred_Simple_IsRule3Enabled,
645 GICXXPred_Simple_IsRule4Enabled,
646 GICXXPred_Simple_IsRule5Enabled,
647 GICXXPred_Simple_IsRule6Enabled,
648 GICXXPred_Simple_IsRule7Enabled,
649 GICXXPred_Simple_IsRule8Enabled,
650 GICXXPred_Simple_IsRule9Enabled,
651 GICXXPred_Simple_IsRule10Enabled,
652 GICXXPred_Simple_IsRule11Enabled,
653 GICXXPred_Simple_IsRule12Enabled,
654 GICXXPred_Simple_IsRule13Enabled,
655 GICXXPred_Simple_IsRule14Enabled,
656 GICXXPred_Simple_IsRule15Enabled,
657 GICXXPred_Simple_IsRule16Enabled,
658 GICXXPred_Simple_IsRule17Enabled,
659 GICXXPred_Simple_IsRule18Enabled,
660 GICXXPred_Simple_IsRule19Enabled,
661 GICXXPred_Simple_IsRule20Enabled,
662 GICXXPred_Simple_IsRule21Enabled,
663 GICXXPred_Simple_IsRule22Enabled,
664 GICXXPred_Simple_IsRule23Enabled,
665 GICXXPred_Simple_IsRule24Enabled,
666 GICXXPred_Simple_IsRule25Enabled,
667 GICXXPred_Simple_IsRule26Enabled,
668 GICXXPred_Simple_IsRule27Enabled,
669 GICXXPred_Simple_IsRule28Enabled,
670 GICXXPred_Simple_IsRule29Enabled,
671 GICXXPred_Simple_IsRule30Enabled,
672 GICXXPred_Simple_IsRule31Enabled,
673 GICXXPred_Simple_IsRule32Enabled,
674 GICXXPred_Simple_IsRule33Enabled,
675 GICXXPred_Simple_IsRule34Enabled,
676 GICXXPred_Simple_IsRule35Enabled,
677 GICXXPred_Simple_IsRule36Enabled,
678 GICXXPred_Simple_IsRule37Enabled,
679 GICXXPred_Simple_IsRule38Enabled,
680 GICXXPred_Simple_IsRule39Enabled,
681 GICXXPred_Simple_IsRule40Enabled,
682 GICXXPred_Simple_IsRule41Enabled,
683 GICXXPred_Simple_IsRule42Enabled,
684 GICXXPred_Simple_IsRule43Enabled,
685 GICXXPred_Simple_IsRule44Enabled,
686 GICXXPred_Simple_IsRule45Enabled,
687 GICXXPred_Simple_IsRule46Enabled,
688 GICXXPred_Simple_IsRule47Enabled,
689 GICXXPred_Simple_IsRule48Enabled,
690 GICXXPred_Simple_IsRule49Enabled,
691 GICXXPred_Simple_IsRule50Enabled,
692 GICXXPred_Simple_IsRule51Enabled,
693 GICXXPred_Simple_IsRule52Enabled,
694 GICXXPred_Simple_IsRule53Enabled,
695 GICXXPred_Simple_IsRule54Enabled,
696 GICXXPred_Simple_IsRule55Enabled,
697 GICXXPred_Simple_IsRule56Enabled,
698 GICXXPred_Simple_IsRule57Enabled,
699 GICXXPred_Simple_IsRule58Enabled,
700 GICXXPred_Simple_IsRule59Enabled,
701 GICXXPred_Simple_IsRule60Enabled,
702 GICXXPred_Simple_IsRule61Enabled,
703 GICXXPred_Simple_IsRule62Enabled,
704 GICXXPred_Simple_IsRule63Enabled,
705 GICXXPred_Simple_IsRule64Enabled,
706 GICXXPred_Simple_IsRule65Enabled,
707 GICXXPred_Simple_IsRule66Enabled,
708 GICXXPred_Simple_IsRule67Enabled,
709};
710
711bool AArch64PostLegalizerCombinerImpl::testSimplePredicate(unsigned Predicate) const {
712 return RuleConfig.isRuleEnabled(Predicate - GICXXPred_Invalid - 1);
713}
714// Custom renderers.
715enum {
716 GICR_Invalid,
717};
718AArch64PostLegalizerCombinerImpl::CustomRendererFn
719AArch64PostLegalizerCombinerImpl::CustomRenderers[] = {
720 nullptr, // GICR_Invalid
721};
722
723bool AArch64PostLegalizerCombinerImpl::tryCombineAll(MachineInstr &I) const {
724 const TargetSubtargetInfo &ST = MF.getSubtarget();
725 const PredicateBitset AvailableFeatures = getAvailableFeatures();
726 B.setInstrAndDebugLoc(I);
727 State.MIs.clear();
728 State.MIs.push_back(&I);
729 if (executeMatchTable(*this, State, ExecInfo, B, getMatchTable(), *ST.getInstrInfo(), MRI, *MRI.getTargetRegisterInfo(), *ST.getRegBankInfo(), AvailableFeatures, /*CoverageInfo*/ nullptr)) {
730 return true;
731 }
732
733 return false;
734}
735
736enum {
737 GICXXCustomAction_GICombiner0 = GICXXCustomAction_Invalid + 1,
738 GICXXCustomAction_GICombiner1,
739 GICXXCustomAction_GICombiner2,
740 GICXXCustomAction_GICombiner3,
741 GICXXCustomAction_GICombiner4,
742 GICXXCustomAction_GICombiner5,
743 GICXXCustomAction_GICombiner6,
744 GICXXCustomAction_GICombiner7,
745 GICXXCustomAction_GICombiner8,
746 GICXXCustomAction_GICombiner9,
747 GICXXCustomAction_GICombiner10,
748 GICXXCustomAction_GICombiner11,
749 GICXXCustomAction_GICombiner12,
750 GICXXCustomAction_GICombiner13,
751 GICXXCustomAction_GICombiner14,
752 GICXXCustomAction_GICombiner15,
753 GICXXCustomAction_GICombiner16,
754 GICXXCustomAction_GICombiner17,
755 GICXXCustomAction_GICombiner18,
756 GICXXCustomAction_GICombiner19,
757 GICXXCustomAction_GICombiner20,
758 GICXXCustomAction_GICombiner21,
759 GICXXCustomAction_GICombiner22,
760 GICXXCustomAction_GICombiner23,
761 GICXXCustomAction_GICombiner24,
762 GICXXCustomAction_GICombiner25,
763 GICXXCustomAction_GICombiner26,
764 GICXXCustomAction_GICombiner27,
765 GICXXCustomAction_GICombiner28,
766 GICXXCustomAction_GICombiner29,
767 GICXXCustomAction_GICombiner30,
768 GICXXCustomAction_GICombiner31,
769 GICXXCustomAction_GICombiner32,
770 GICXXCustomAction_GICombiner33,
771 GICXXCustomAction_GICombiner34,
772 GICXXCustomAction_GICombiner35,
773 GICXXCustomAction_GICombiner36,
774 GICXXCustomAction_GICombiner37,
775 GICXXCustomAction_GICombiner38,
776 GICXXCustomAction_GICombiner39,
777 GICXXCustomAction_GICombiner40,
778 GICXXCustomAction_GICombiner41,
779 GICXXCustomAction_GICombiner42,
780 GICXXCustomAction_GICombiner43,
781 GICXXCustomAction_GICombiner44,
782 GICXXCustomAction_GICombiner45,
783 GICXXCustomAction_GICombiner46,
784 GICXXCustomAction_GICombiner47,
785 GICXXCustomAction_GICombiner48,
786 GICXXCustomAction_GICombiner49,
787 GICXXCustomAction_GICombiner50,
788 GICXXCustomAction_GICombiner51,
789 GICXXCustomAction_GICombiner52,
790 GICXXCustomAction_GICombiner53,
791 GICXXCustomAction_GICombiner54,
792 GICXXCustomAction_GICombiner55,
793};
794bool AArch64PostLegalizerCombinerImpl::runCustomAction(unsigned ApplyID, const MatcherState &State, NewMIVector &OutMIs) const {
795 Helper.getBuilder().setInstrAndDebugLoc(*State.MIs[0]);
796 switch(ApplyID) {
797 case GICXXCustomAction_GICombiner0:{
798 // Match Patterns
799 if(![&](){return Helper.matchCombineCopy(*State.MIs[0]);}()) {
800 return false;
801 }
802 // Apply Patterns
803 Helper.applyCombineCopy(*State.MIs[0]);
804 return true;
805 }
806 case GICXXCustomAction_GICombiner1:{
807 PreferredTuple GIMatchData_matchinfo;
808 // Match Patterns
809 if(![&](){return Helper.matchCombineExtendingLoads(*State.MIs[0], GIMatchData_matchinfo);}()) {
810 return false;
811 }
812 // Apply Patterns
813 Helper.applyCombineExtendingLoads(*State.MIs[0], GIMatchData_matchinfo);
814 return true;
815 }
816 case GICXXCustomAction_GICombiner2:{
817 std::function<void(MachineIRBuilder &)> GIMatchData_matchinfo;
818 // Match Patterns
819 if(![&](){return Helper.matchCombineLoadWithAndMask(*State.MIs[0], GIMatchData_matchinfo);}()) {
820 return false;
821 }
822 // Apply Patterns
823 Helper.applyBuildFn(*State.MIs[0], GIMatchData_matchinfo);
824 return true;
825 }
826 case GICXXCustomAction_GICombiner3:{
827 IndexedLoadStoreMatchInfo GIMatchData_matchinfo;
828 // Match Patterns
829 if(![&](){return Helper.matchCombineIndexedLoadStore(*State.MIs[0], GIMatchData_matchinfo);}()) {
830 return false;
831 }
832 // Apply Patterns
833 Helper.applyCombineIndexedLoadStore(*State.MIs[0], GIMatchData_matchinfo);
834 return true;
835 }
836 case GICXXCustomAction_GICombiner4:{
837 // Match Patterns
838 if(![&](){return Helper.matchSextTruncSextLoad(*State.MIs[0]);}()) {
839 return false;
840 }
841 // Apply Patterns
842 Helper.applySextTruncSextLoad(*State.MIs[0]);
843 return true;
844 }
845 case GICXXCustomAction_GICombiner5:{
846 // Match Patterns
847 if(![&](){return matchMutateAnyExtToZExt(*State.MIs[0], MRI);}()) {
848 return false;
849 }
850 // Apply Patterns
851 applyMutateAnyExtToZExt(*State.MIs[0], MRI, B, Observer);
852 return true;
853 }
854 case GICXXCustomAction_GICombiner6:{
855 InstructionStepsMatchInfo GIMatchData_info;
856 // Match Patterns
857 if(![&](){return Helper.matchHoistLogicOpWithSameOpcodeHands(*State.MIs[0], GIMatchData_info);}()) {
858 return false;
859 }
860 // Apply Patterns
861 Helper.applyBuildInstructionSteps(*State.MIs[0], GIMatchData_info);
862 return true;
863 }
864 case GICXXCustomAction_GICombiner7:{
865 Register GIMatchData_matchinfo;
866 // Match Patterns
867 if(![&](){return Helper.matchRedundantAnd(*State.MIs[0], GIMatchData_matchinfo);}()) {
868 return false;
869 }
870 // Apply Patterns
871 Helper.replaceSingleDefInstWithReg(*State.MIs[0], GIMatchData_matchinfo);
872 return true;
873 }
874 case GICXXCustomAction_GICombiner8:{
875 std::pair<Register, Register> GIMatchData_matchinfo;
876 // Match Patterns
877 if(![&](){return Helper.matchXorOfAndWithSameReg(*State.MIs[0], GIMatchData_matchinfo);}()) {
878 return false;
879 }
880 // Apply Patterns
881 Helper.applyXorOfAndWithSameReg(*State.MIs[0], GIMatchData_matchinfo);
882 return true;
883 }
884 case GICXXCustomAction_GICombiner9:{
885 std::tuple<unsigned, LLT, Register> GIMatchData_matchinfo;
886 // Match Patterns
887 if(![&](){return matchExtractVecEltPairwiseAdd(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
888 return false;
889 }
890 // Apply Patterns
891 applyExtractVecEltPairwiseAdd(*State.MIs[0], MRI, B, GIMatchData_matchinfo);
892 return true;
893 }
894 case GICXXCustomAction_GICombiner10:{
895 Register GIMatchData_matchinfo;
896 // Match Patterns
897 if(![&](){return Helper.matchRedundantOr(*State.MIs[0], GIMatchData_matchinfo);}()) {
898 return false;
899 }
900 // Apply Patterns
901 Helper.replaceSingleDefInstWithReg(*State.MIs[0], GIMatchData_matchinfo);
902 return true;
903 }
904 case GICXXCustomAction_GICombiner11:{
905 std::function<void(MachineIRBuilder&, Register)> GIMatchData_matchinfo;
906 // Match Patterns
907 if(![&](){return matchAArch64MulConstCombine(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
908 return false;
909 }
910 // Apply Patterns
911 applyAArch64MulConstCombine(*State.MIs[0], MRI, B, GIMatchData_matchinfo);
912 return true;
913 }
914 case GICXXCustomAction_GICombiner12:{
915 // Match Patterns
916 if(![&](){return Helper.matchRedundantSExtInReg(*State.MIs[0]);}()) {
917 return false;
918 }
919 // Apply Patterns
920 Helper.replaceSingleDefInstWithOperand(*State.MIs[0], 1);
921 return true;
922 }
923 case GICXXCustomAction_GICombiner13:{
924 std::function<void(MachineIRBuilder &)> GIMatchData_info;
925 // Match Patterns
926 if(![&](){return Helper.matchBitfieldExtractFromSExtInReg(*State.MIs[0], GIMatchData_info);}()) {
927 return false;
928 }
929 // Apply Patterns
930 Helper.applyBuildFn(*State.MIs[0], GIMatchData_info);
931 return true;
932 }
933 case GICXXCustomAction_GICombiner14:{
934 std::function<void(MachineIRBuilder &)> GIMatchData_info;
935 // Match Patterns
936 if(![&](){return Helper.matchBitfieldExtractFromAnd(*State.MIs[0], GIMatchData_info);}()) {
937 return false;
938 }
939 // Apply Patterns
940 Helper.applyBuildFn(*State.MIs[0], GIMatchData_info);
941 return true;
942 }
943 case GICXXCustomAction_GICombiner15:{
944 std::function<void(MachineIRBuilder &)> GIMatchData_info;
945 // Match Patterns
946 if(![&](){return Helper.matchBitfieldExtractFromShr(*State.MIs[0], GIMatchData_info);}()) {
947 return false;
948 }
949 // Apply Patterns
950 Helper.applyBuildFn(*State.MIs[0], GIMatchData_info);
951 return true;
952 }
953 case GICXXCustomAction_GICombiner16:{
954 std::function<void(MachineIRBuilder &)> GIMatchData_info;
955 // Match Patterns
956 if(![&](){return Helper.matchBitfieldExtractFromShrAnd(*State.MIs[0], GIMatchData_info);}()) {
957 return false;
958 }
959 // Apply Patterns
960 Helper.applyBuildFn(*State.MIs[0], GIMatchData_info);
961 return true;
962 }
963 case GICXXCustomAction_GICombiner17:{
964 // Match Patterns
965 if(![&](){return Helper.matchRotateOutOfRange(*State.MIs[0]);}()) {
966 return false;
967 }
968 // Apply Patterns
969 Helper.applyRotateOutOfRange(*State.MIs[0]);
970 return true;
971 }
972 case GICXXCustomAction_GICombiner18:{
973 int64_t GIMatchData_matchinfo;
974 // Match Patterns
975 if(![&](){return Helper.matchICmpToTrueFalseKnownBits(*State.MIs[0], GIMatchData_matchinfo);}()) {
976 return false;
977 }
978 // Apply Patterns
979 Helper.replaceInstWithConstant(*State.MIs[0], GIMatchData_matchinfo);
980 return true;
981 }
982 case GICXXCustomAction_GICombiner19:{
983 Register GIMatchData_matchinfo;
984 // Match Patterns
985 if(![&](){return Helper.matchCombineMergeUnmerge(*State.MIs[0], GIMatchData_matchinfo);}()) {
986 return false;
987 }
988 // Apply Patterns
989 Helper.replaceSingleDefInstWithReg(*State.MIs[0], GIMatchData_matchinfo);
990 return true;
991 }
992 case GICXXCustomAction_GICombiner20:{
993 unsigned GIMatchData_matchinfo;
994 // Match Patterns
995 if(![&](){return Helper.matchConstantSelectCmp(*State.MIs[0], GIMatchData_matchinfo);}()) {
996 return false;
997 }
998 // Apply Patterns
999 Helper.replaceSingleDefInstWithOperand(*State.MIs[0], GIMatchData_matchinfo);
1000 return true;
1001 }
1002 case GICXXCustomAction_GICombiner21:{
1003 std::function<void(MachineIRBuilder &)> GIMatchData_info;
1004 // Match Patterns
1005 if(![&](){return Helper.matchSelectIMinMax(State.MIs[0]->getOperand(0), GIMatchData_info);}()) {
1006 return false;
1007 }
1008 // Apply Patterns
1009 Helper.applyBuildFnMO(State.MIs[0]->getOperand(0), GIMatchData_info);
1010 return true;
1011 }
1012 case GICXXCustomAction_GICombiner22:{
1013 std::function<void(MachineIRBuilder &)> GIMatchData_matchinfo;
1014 // Match Patterns
1015 if(![&](){return Helper.matchSelect(*State.MIs[0], GIMatchData_matchinfo);}()) {
1016 return false;
1017 }
1018 // Apply Patterns
1019 Helper.applyBuildFn(*State.MIs[0], GIMatchData_matchinfo);
1020 return true;
1021 }
1022 case GICXXCustomAction_GICombiner23:{
1023 // Match Patterns
1024 if(![&](){return matchFoldMergeToZext(*State.MIs[0], MRI);}()) {
1025 return false;
1026 }
1027 // Apply Patterns
1028 applyFoldMergeToZext(*State.MIs[0], MRI, B, Observer);
1029 return true;
1030 }
1031 case GICXXCustomAction_GICombiner24:{
1032 APInt GIMatchData_matchinfo;
1033 // Match Patterns
1034 if(![&](){return Helper.matchConstantFoldBinOp(*State.MIs[0], GIMatchData_matchinfo);}()) {
1035 return false;
1036 }
1037 // Apply Patterns
1038 Helper.replaceInstWithConstant(*State.MIs[0], GIMatchData_matchinfo);
1039 return true;
1040 }
1041 case GICXXCustomAction_GICombiner25:{
1042 ConstantFP* GIMatchData_matchinfo;
1043 // Match Patterns
1044 if(![&](){return Helper.matchConstantFoldFPBinOp(*State.MIs[0], GIMatchData_matchinfo);}()) {
1045 return false;
1046 }
1047 // Apply Patterns
1048 Helper.replaceInstWithFConstant(*State.MIs[0], GIMatchData_matchinfo);
1049 return true;
1050 }
1051 case GICXXCustomAction_GICombiner26:{
1052 // Match Patterns
1053 if(![&](){return Helper.matchSelectSameVal(*State.MIs[0]);}()) {
1054 return false;
1055 }
1056 // Apply Patterns
1057 Helper.replaceSingleDefInstWithOperand(*State.MIs[0], 2);
1058 return true;
1059 }
1060 case GICXXCustomAction_GICombiner27:{
1061 // Match Patterns
1062 if(![&](){return Helper.matchOperandIsZero(*State.MIs[0], 1);}()) {
1063 return false;
1064 }
1065 // Apply Patterns
1066 Helper.replaceSingleDefInstWithOperand(*State.MIs[0], 1);
1067 return true;
1068 }
1069 case GICXXCustomAction_GICombiner28:{
1070 Register GIMatchData_info;
1071 // Match Patterns
1072 if(![&](){return Helper.matchCombineI2PToP2I(*State.MIs[0], GIMatchData_info);}()) {
1073 return false;
1074 }
1075 // Apply Patterns
1076 Helper.applyCombineI2PToP2I(*State.MIs[0], GIMatchData_info);
1077 return true;
1078 }
1079 case GICXXCustomAction_GICombiner29:{
1080 Register GIMatchData_info;
1081 // Match Patterns
1082 if(![&](){GIMatchData_info = State.MIs[1]->getOperand(1).getReg(); return true;}()) {
1083 return false;
1084 }
1085 // Apply Patterns
1086 Helper.applyCombineP2IToI2P(*State.MIs[0], GIMatchData_info);
1087 return true;
1088 }
1089 case GICXXCustomAction_GICombiner30:{
1090 Register GIMatchData_matchinfo;
1091 // Match Patterns
1092 if(![&](){return Helper.matchCombineAnyExtTrunc(*State.MIs[0], GIMatchData_matchinfo);}()) {
1093 return false;
1094 }
1095 // Apply Patterns
1096 Helper.replaceSingleDefInstWithReg(*State.MIs[0], GIMatchData_matchinfo);
1097 return true;
1098 }
1099 case GICXXCustomAction_GICombiner31:{
1100 Register GIMatchData_matchinfo;
1101 // Match Patterns
1102 if(![&](){return Helper.matchBuildVectorIdentityFold(*State.MIs[0], GIMatchData_matchinfo);}()) {
1103 return false;
1104 }
1105 // Apply Patterns
1106 Helper.replaceSingleDefInstWithReg(*State.MIs[0], GIMatchData_matchinfo);
1107 return true;
1108 }
1109 case GICXXCustomAction_GICombiner32:{
1110 Register GIMatchData_matchinfo;
1111 // Match Patterns
1112 if(![&](){return Helper.matchTruncBuildVectorFold(*State.MIs[0], GIMatchData_matchinfo);}()) {
1113 return false;
1114 }
1115 // Apply Patterns
1116 Helper.replaceSingleDefInstWithReg(*State.MIs[0], GIMatchData_matchinfo);
1117 return true;
1118 }
1119 case GICXXCustomAction_GICombiner33:{
1120 Register GIMatchData_matchinfo;
1121 // Match Patterns
1122 if(![&](){return Helper.matchTruncLshrBuildVectorFold(*State.MIs[0], GIMatchData_matchinfo);}()) {
1123 return false;
1124 }
1125 // Apply Patterns
1126 Helper.replaceSingleDefInstWithReg(*State.MIs[0], GIMatchData_matchinfo);
1127 return true;
1128 }
1129 case GICXXCustomAction_GICombiner34:{
1130 // Match Patterns
1131 if(![&](){return MRI.getType(State.MIs[1]->getOperand(1).getReg()) == MRI.getType(State.MIs[0]->getOperand(0).getReg());}()) {
1132 return false;
1133 }
1134 // Apply Patterns
1135 Helper.replaceSingleDefInstWithReg(*State.MIs[0], State.MIs[1]->getOperand(1).getReg());
1136 return true;
1137 }
1138 case GICXXCustomAction_GICombiner35:{
1139 PtrAddChain GIMatchData_matchinfo;
1140 // Match Patterns
1141 if(![&](){return Helper.matchPtrAddImmedChain(*State.MIs[0], GIMatchData_matchinfo);}()) {
1142 return false;
1143 }
1144 // Apply Patterns
1145 Helper.applyPtrAddImmedChain(*State.MIs[0], GIMatchData_matchinfo);
1146 return true;
1147 }
1148 case GICXXCustomAction_GICombiner36:{
1149 std::function<void(MachineIRBuilder &)> GIMatchData_info;
1150 // Match Patterns
1151 if(![&](){return Helper.matchOverlappingAnd(*State.MIs[0], GIMatchData_info);}()) {
1152 return false;
1153 }
1154 // Apply Patterns
1155 Helper.applyBuildFn(*State.MIs[0], GIMatchData_info);
1156 return true;
1157 }
1158 case GICXXCustomAction_GICombiner37:{
1159 // Match Patterns
1160 if(![&](){return matchSplitStoreZero128(*State.MIs[0], MRI);}()) {
1161 return false;
1162 }
1163 // Apply Patterns
1164 applySplitStoreZero128(*State.MIs[0], MRI, B, Observer);
1165 return true;
1166 }
1167 case GICXXCustomAction_GICombiner38:{
1168 // Match Patterns
1169 if(![&](){return Helper.matchAnyExplicitUseIsUndef(*State.MIs[0]);}()) {
1170 return false;
1171 }
1172 // Apply Patterns
1173 Helper.replaceInstWithFConstant(*State.MIs[0], 0.0);
1174 return true;
1175 }
1176 case GICXXCustomAction_GICombiner39:{
1177 // Match Patterns
1178 if(![&](){return Helper.matchAnyExplicitUseIsUndef(*State.MIs[0]);}()) {
1179 return false;
1180 }
1181 // Apply Patterns
1182 Helper.replaceInstWithConstant(*State.MIs[0], 0);
1183 return true;
1184 }
1185 case GICXXCustomAction_GICombiner40:{
1186 // Match Patterns
1187 if(![&](){return Helper.matchAnyExplicitUseIsUndef(*State.MIs[0]);}()) {
1188 return false;
1189 }
1190 // Apply Patterns
1191 Helper.replaceInstWithConstant(*State.MIs[0], -1);
1192 return true;
1193 }
1194 case GICXXCustomAction_GICombiner41:{
1195 // Match Patterns
1196 if(![&](){return Helper.matchOperandIsUndef(*State.MIs[0], 1);}()) {
1197 return false;
1198 }
1199 // Apply Patterns
1200 Helper.replaceInstWithConstant(*State.MIs[0], 0);
1201 return true;
1202 }
1203 case GICXXCustomAction_GICombiner42:{
1204 // Match Patterns
1205 if(![&](){return Helper.matchOperandIsUndef(*State.MIs[0], 2);}()) {
1206 return false;
1207 }
1208 // Apply Patterns
1209 Helper.replaceInstWithUndef(*State.MIs[0]);
1210 return true;
1211 }
1212 case GICXXCustomAction_GICombiner43:{
1213 // Match Patterns
1214 if(![&](){return Helper.matchAnyExplicitUseIsUndef(*State.MIs[0]);}()) {
1215 return false;
1216 }
1217 // Apply Patterns
1218 Helper.replaceInstWithUndef(*State.MIs[0]);
1219 return true;
1220 }
1221 case GICXXCustomAction_GICombiner44:{
1222 // Match Patterns
1223 if(![&](){return Helper.matchAllExplicitUsesAreUndef(*State.MIs[0]);}()) {
1224 return false;
1225 }
1226 // Apply Patterns
1227 Helper.replaceInstWithUndef(*State.MIs[0]);
1228 return true;
1229 }
1230 case GICXXCustomAction_GICombiner45:{
1231 // Match Patterns
1232 if(![&](){return Helper.matchUndefShuffleVectorMask(*State.MIs[0]);}()) {
1233 return false;
1234 }
1235 // Apply Patterns
1236 Helper.replaceInstWithUndef(*State.MIs[0]);
1237 return true;
1238 }
1239 case GICXXCustomAction_GICombiner46:{
1240 // Match Patterns
1241 if(![&](){return Helper.matchUndefStore(*State.MIs[0]);}()) {
1242 return false;
1243 }
1244 // Apply Patterns
1245 Helper.eraseInst(*State.MIs[0]);
1246 return true;
1247 }
1248 case GICXXCustomAction_GICombiner47:{
1249 std::function<void(MachineIRBuilder &)> GIMatchData_info;
1250 // Match Patterns
1251 if(![&](){return Helper.matchCombineUnmergeUndef(*State.MIs[0], GIMatchData_info);}()) {
1252 return false;
1253 }
1254 // Apply Patterns
1255 Helper.applyBuildFn(*State.MIs[0], GIMatchData_info);
1256 return true;
1257 }
1258 case GICXXCustomAction_GICombiner48:{
1259 // Match Patterns
1260 if(![&](){return Helper.matchInsertExtractVecEltOutOfBounds(*State.MIs[0]);}()) {
1261 return false;
1262 }
1263 // Apply Patterns
1264 Helper.replaceInstWithUndef(*State.MIs[0]);
1265 return true;
1266 }
1267 case GICXXCustomAction_GICombiner49:{
1268 std::function<void(MachineIRBuilder &)> GIMatchData_info;
1269 // Match Patterns
1270 if(![&](){return Helper.matchSimplifySelectToMinMax(*State.MIs[0], GIMatchData_info);}()) {
1271 return false;
1272 }
1273 // Apply Patterns
1274 Helper.applyBuildFn(*State.MIs[0], GIMatchData_info);
1275 return true;
1276 }
1277 case GICXXCustomAction_GICombiner50:{
1278 std::tuple<Register, Register, Register> GIMatchData_matchinfo;
1279 // Match Patterns
1280 if(![&](){return matchOrToBSP(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
1281 return false;
1282 }
1283 // Apply Patterns
1284 applyOrToBSP(*State.MIs[0], MRI, B, GIMatchData_matchinfo);
1285 return true;
1286 }
1287 case GICXXCustomAction_GICombiner51:{
1288 SmallVector<Register> GIMatchData_matchinfo;
1289 // Match Patterns
1290 if(![&](){return Helper.matchCombineConcatVectors(*State.MIs[0], GIMatchData_matchinfo);}()) {
1291 return false;
1292 }
1293 // Apply Patterns
1294 Helper.applyCombineConcatVectors(*State.MIs[0], GIMatchData_matchinfo);
1295 return true;
1296 }
1297 case GICXXCustomAction_GICombiner52:{
1298 // Match Patterns
1299 if(![&](){return Helper.matchCommuteConstantToRHS(*State.MIs[0]);}()) {
1300 return false;
1301 }
1302 // Apply Patterns
1303 Helper.applyCommuteBinOpOperands(*State.MIs[0]);
1304 return true;
1305 }
1306 case GICXXCustomAction_GICombiner53:{
1307 // Match Patterns
1308 if(![&](){return Helper.matchCommuteFPConstantToRHS(*State.MIs[0]);}()) {
1309 return false;
1310 }
1311 // Apply Patterns
1312 Helper.applyCommuteBinOpOperands(*State.MIs[0]);
1313 return true;
1314 }
1315 case GICXXCustomAction_GICombiner54:{
1316 std::function<void(MachineIRBuilder &)> GIMatchData_matchinfo;
1317 // Match Patterns
1318 if(![&](){return !isGuaranteedNotToBePoison(State.MIs[0]->getOperand(1).getReg(), MRI) && Helper.matchFreezeOfSingleMaybePoisonOperand(*State.MIs[0], GIMatchData_matchinfo);}()) {
1319 return false;
1320 }
1321 // Apply Patterns
1322 Helper.applyBuildFn(*State.MIs[0], GIMatchData_matchinfo);
1323 return true;
1324 }
1325 case GICXXCustomAction_GICombiner55:{
1326 Register GIMatchData_matchinfo;
1327 // Match Patterns
1328 if(![&](){return matchCombineMulCMLT(*State.MIs[0], MRI, GIMatchData_matchinfo);}()) {
1329 return false;
1330 }
1331 // Apply Patterns
1332 applyCombineMulCMLT(*State.MIs[0], MRI, B, GIMatchData_matchinfo);
1333 return true;
1334 }
1335 }
1336 llvm_unreachable("Unknown Apply Action");
1337}
1338#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
1339#define GIMT_Encode2(Val) uint8_t(Val), uint8_t((uint16_t)Val >> 8)
1340#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)
1341#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)
1342#else
1343#define GIMT_Encode2(Val) uint8_t((uint16_t)Val >> 8), uint8_t(Val)
1344#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)
1345#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)
1346#endif
1347const uint8_t *AArch64PostLegalizerCombinerImpl::getMatchTable() const {
1348 constexpr static uint8_t MatchTable0[] = {
1349 GIM_SwitchOpcode, /*MI*/0, /*[*/GIMT_Encode2(19), GIMT_Encode2(229), /*)*//*default:*//*Label 71*/ GIMT_Encode4(2845),
1350 /*TargetOpcode::COPY*//*Label 0*/ GIMT_Encode4(850), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
1351 /*TargetOpcode::G_ADD*//*Label 1*/ GIMT_Encode4(862),
1352 /*TargetOpcode::G_SUB*//*Label 2*/ GIMT_Encode4(987),
1353 /*TargetOpcode::G_MUL*//*Label 3*/ GIMT_Encode4(1033),
1354 /*TargetOpcode::G_SDIV*//*Label 4*/ GIMT_Encode4(1135),
1355 /*TargetOpcode::G_UDIV*//*Label 5*/ GIMT_Encode4(1147),
1356 /*TargetOpcode::G_SREM*//*Label 6*/ GIMT_Encode4(1170),
1357 /*TargetOpcode::G_UREM*//*Label 7*/ GIMT_Encode4(1182), GIMT_Encode4(0), GIMT_Encode4(0),
1358 /*TargetOpcode::G_AND*//*Label 8*/ GIMT_Encode4(1205),
1359 /*TargetOpcode::G_OR*//*Label 9*/ GIMT_Encode4(1344),
1360 /*TargetOpcode::G_XOR*//*Label 10*/ GIMT_Encode4(1458), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
1361 /*TargetOpcode::G_UNMERGE_VALUES*//*Label 11*/ GIMT_Encode4(1537), GIMT_Encode4(0),
1362 /*TargetOpcode::G_MERGE_VALUES*//*Label 12*/ GIMT_Encode4(1549),
1363 /*TargetOpcode::G_BUILD_VECTOR*//*Label 13*/ GIMT_Encode4(1572),
1364 /*TargetOpcode::G_BUILD_VECTOR_TRUNC*//*Label 14*/ GIMT_Encode4(1584),
1365 /*TargetOpcode::G_CONCAT_VECTORS*//*Label 15*/ GIMT_Encode4(1596),
1366 /*TargetOpcode::G_PTRTOINT*//*Label 16*/ GIMT_Encode4(1608),
1367 /*TargetOpcode::G_INTTOPTR*//*Label 17*/ GIMT_Encode4(1630),
1368 /*TargetOpcode::G_BITCAST*//*Label 18*/ GIMT_Encode4(1642),
1369 /*TargetOpcode::G_FREEZE*//*Label 19*/ GIMT_Encode4(1664), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
1370 /*TargetOpcode::G_LOAD*//*Label 20*/ GIMT_Encode4(1676),
1371 /*TargetOpcode::G_SEXTLOAD*//*Label 21*/ GIMT_Encode4(1699),
1372 /*TargetOpcode::G_ZEXTLOAD*//*Label 22*/ GIMT_Encode4(1722), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
1373 /*TargetOpcode::G_STORE*//*Label 23*/ GIMT_Encode4(1745), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
1374 /*TargetOpcode::G_ANYEXT*//*Label 24*/ GIMT_Encode4(1779),
1375 /*TargetOpcode::G_TRUNC*//*Label 25*/ GIMT_Encode4(1802), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
1376 /*TargetOpcode::G_SEXT_INREG*//*Label 26*/ GIMT_Encode4(1836), GIMT_Encode4(0),
1377 /*TargetOpcode::G_SHL*//*Label 27*/ GIMT_Encode4(1870),
1378 /*TargetOpcode::G_LSHR*//*Label 28*/ GIMT_Encode4(1927),
1379 /*TargetOpcode::G_ASHR*//*Label 29*/ GIMT_Encode4(1995), GIMT_Encode4(0), GIMT_Encode4(0),
1380 /*TargetOpcode::G_ROTR*//*Label 30*/ GIMT_Encode4(2063),
1381 /*TargetOpcode::G_ROTL*//*Label 31*/ GIMT_Encode4(2098),
1382 /*TargetOpcode::G_ICMP*//*Label 32*/ GIMT_Encode4(2133), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
1383 /*TargetOpcode::G_SELECT*//*Label 33*/ GIMT_Encode4(2145),
1384 /*TargetOpcode::G_UADDO*//*Label 34*/ GIMT_Encode4(2240), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
1385 /*TargetOpcode::G_SADDO*//*Label 35*/ GIMT_Encode4(2252), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
1386 /*TargetOpcode::G_UMULO*//*Label 36*/ GIMT_Encode4(2264),
1387 /*TargetOpcode::G_SMULO*//*Label 37*/ GIMT_Encode4(2276),
1388 /*TargetOpcode::G_UMULH*//*Label 38*/ GIMT_Encode4(2288),
1389 /*TargetOpcode::G_SMULH*//*Label 39*/ GIMT_Encode4(2300),
1390 /*TargetOpcode::G_UADDSAT*//*Label 40*/ GIMT_Encode4(2312),
1391 /*TargetOpcode::G_SADDSAT*//*Label 41*/ GIMT_Encode4(2324), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
1392 /*TargetOpcode::G_SMULFIX*//*Label 42*/ GIMT_Encode4(2336),
1393 /*TargetOpcode::G_UMULFIX*//*Label 43*/ GIMT_Encode4(2348),
1394 /*TargetOpcode::G_SMULFIXSAT*//*Label 44*/ GIMT_Encode4(2360),
1395 /*TargetOpcode::G_UMULFIXSAT*//*Label 45*/ GIMT_Encode4(2372), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
1396 /*TargetOpcode::G_FADD*//*Label 46*/ GIMT_Encode4(2384),
1397 /*TargetOpcode::G_FSUB*//*Label 47*/ GIMT_Encode4(2430),
1398 /*TargetOpcode::G_FMUL*//*Label 48*/ GIMT_Encode4(2442), GIMT_Encode4(0), GIMT_Encode4(0),
1399 /*TargetOpcode::G_FDIV*//*Label 49*/ GIMT_Encode4(2508), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
1400 /*TargetOpcode::G_FNEG*//*Label 50*/ GIMT_Encode4(2520), GIMT_Encode4(0),
1401 /*TargetOpcode::G_FPTRUNC*//*Label 51*/ GIMT_Encode4(2550),
1402 /*TargetOpcode::G_FPTOSI*//*Label 52*/ GIMT_Encode4(2572),
1403 /*TargetOpcode::G_FPTOUI*//*Label 53*/ GIMT_Encode4(2584),
1404 /*TargetOpcode::G_SITOFP*//*Label 54*/ GIMT_Encode4(2596),
1405 /*TargetOpcode::G_UITOFP*//*Label 55*/ GIMT_Encode4(2608), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
1406 /*TargetOpcode::G_FMINNUM*//*Label 56*/ GIMT_Encode4(2620),
1407 /*TargetOpcode::G_FMAXNUM*//*Label 57*/ GIMT_Encode4(2632),
1408 /*TargetOpcode::G_FMINNUM_IEEE*//*Label 58*/ GIMT_Encode4(2644),
1409 /*TargetOpcode::G_FMAXNUM_IEEE*//*Label 59*/ GIMT_Encode4(2656),
1410 /*TargetOpcode::G_FMINIMUM*//*Label 60*/ GIMT_Encode4(2668),
1411 /*TargetOpcode::G_FMAXIMUM*//*Label 61*/ GIMT_Encode4(2680), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
1412 /*TargetOpcode::G_PTR_ADD*//*Label 62*/ GIMT_Encode4(2692), GIMT_Encode4(0),
1413 /*TargetOpcode::G_SMIN*//*Label 63*/ GIMT_Encode4(2727),
1414 /*TargetOpcode::G_SMAX*//*Label 64*/ GIMT_Encode4(2739),
1415 /*TargetOpcode::G_UMIN*//*Label 65*/ GIMT_Encode4(2751),
1416 /*TargetOpcode::G_UMAX*//*Label 66*/ GIMT_Encode4(2763),
1417 /*TargetOpcode::G_ABS*//*Label 67*/ GIMT_Encode4(2775), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
1418 /*TargetOpcode::G_INSERT_VECTOR_ELT*//*Label 68*/ GIMT_Encode4(2787),
1419 /*TargetOpcode::G_EXTRACT_VECTOR_ELT*//*Label 69*/ GIMT_Encode4(2799),
1420 /*TargetOpcode::G_SHUFFLE_VECTOR*//*Label 70*/ GIMT_Encode4(2822),
1421 // Label 0: @850
1422 GIM_Try, /*On fail goto*//*Label 72*/ GIMT_Encode4(861), // Rule ID 0 //
1423 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule0Enabled),
1424 // MIs[0] d
1425 // No operand predicates
1426 // MIs[0] s
1427 // No operand predicates
1428 // Combiner Rule #0: copy_prop
1429 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner0),
1430 // Label 72: @861
1431 GIM_Reject,
1432 // Label 1: @862
1433 GIM_Try, /*On fail goto*//*Label 73*/ GIMT_Encode4(873), // Rule ID 35 //
1434 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule25Enabled),
1435 // Combiner Rule #25: constant_fold_binop; wip_match_opcode 'G_ADD'
1436 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner24),
1437 // Label 73: @873
1438 GIM_Try, /*On fail goto*//*Label 74*/ GIMT_Encode4(884), // Rule ID 97 //
1439 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule55Enabled),
1440 // Combiner Rule #55: propagate_undef_any_op; wip_match_opcode 'G_ADD'
1441 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner43),
1442 // Label 74: @884
1443 GIM_Try, /*On fail goto*//*Label 75*/ GIMT_Encode4(895), // Rule ID 112 //
1444 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
1445 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_ADD'
1446 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
1447 // Label 75: @895
1448 GIM_Try, /*On fail goto*//*Label 76*/ GIMT_Encode4(929), // Rule ID 73 //
1449 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule38Enabled),
1450 // MIs[0] dst
1451 // No operand predicates
1452 // MIs[0] __add_sub_reg_match_0.tmp
1453 GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
1454 GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_SUB),
1455 // MIs[1] src
1456 // No operand predicates
1457 // MIs[1] __add_sub_reg_match_0.x
1458 // No operand predicates
1459 // MIs[0] __add_sub_reg_match_0.x
1460 GIM_CheckIsSameOperandIgnoreCopies, /*MI*/0, /*OpIdx*/2, /*OtherMI*/1, /*OtherOpIdx*/2,
1461 GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/1, /*NewOpIdx*/1,
1462 GIM_CheckIsSafeToFold, /*NumInsns*/1,
1463 // Combiner Rule #38: add_sub_reg @ [__add_sub_reg_match_0[1]]
1464 GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/1, /*NewOpIdx*/1,
1465 GIR_EraseRootFromParent_Done,
1466 // Label 76: @929
1467 GIM_Try, /*On fail goto*//*Label 77*/ GIMT_Encode4(963), // Rule ID 72 //
1468 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule38Enabled),
1469 // MIs[0] dst
1470 // No operand predicates
1471 // MIs[0] __add_sub_reg_match_0.x
1472 // No operand predicates
1473 // MIs[0] __add_sub_reg_match_0.tmp
1474 GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1]
1475 GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_SUB),
1476 // MIs[1] src
1477 // No operand predicates
1478 // MIs[1] __add_sub_reg_match_0.x
1479 GIM_CheckIsSameOperandIgnoreCopies, /*MI*/1, /*OpIdx*/2, /*OtherMI*/0, /*OtherOpIdx*/1,
1480 GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/1, /*NewOpIdx*/1,
1481 GIM_CheckIsSafeToFold, /*NumInsns*/1,
1482 // Combiner Rule #38: add_sub_reg @ [__add_sub_reg_match_0[0]]
1483 GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/1, /*NewOpIdx*/1,
1484 GIR_EraseRootFromParent_Done,
1485 // Label 77: @963
1486 GIM_Try, /*On fail goto*//*Label 78*/ GIMT_Encode4(986), // Rule ID 50 //
1487 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule28Enabled),
1488 // MIs[0] dst
1489 // No operand predicates
1490 // MIs[0] lhs
1491 // No operand predicates
1492 // MIs[0] Operand 2
1493 GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 0,
1494 GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
1495 // Combiner Rule #28: right_identity_zero @ [__right_identity_zero_match_0[1]]
1496 GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
1497 GIR_EraseRootFromParent_Done,
1498 // Label 78: @986
1499 GIM_Reject,
1500 // Label 2: @987
1501 GIM_Try, /*On fail goto*//*Label 79*/ GIMT_Encode4(998), // Rule ID 36 //
1502 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule25Enabled),
1503 // Combiner Rule #25: constant_fold_binop; wip_match_opcode 'G_SUB'
1504 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner24),
1505 // Label 79: @998
1506 GIM_Try, /*On fail goto*//*Label 80*/ GIMT_Encode4(1009), // Rule ID 100 //
1507 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule55Enabled),
1508 // Combiner Rule #55: propagate_undef_any_op; wip_match_opcode 'G_SUB'
1509 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner43),
1510 // Label 80: @1009
1511 GIM_Try, /*On fail goto*//*Label 81*/ GIMT_Encode4(1032), // Rule ID 49 //
1512 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule28Enabled),
1513 // MIs[0] dst
1514 // No operand predicates
1515 // MIs[0] lhs
1516 // No operand predicates
1517 // MIs[0] Operand 2
1518 GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 0,
1519 GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
1520 // Combiner Rule #28: right_identity_zero @ [__right_identity_zero_match_0[0]]
1521 GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
1522 GIR_EraseRootFromParent_Done,
1523 // Label 81: @1032
1524 GIM_Reject,
1525 // Label 3: @1033
1526 GIM_Try, /*On fail goto*//*Label 82*/ GIMT_Encode4(1044), // Rule ID 18 //
1527 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule11Enabled),
1528 // Combiner Rule #11: mul_const; wip_match_opcode 'G_MUL'
1529 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner11),
1530 // Label 82: @1044
1531 GIM_Try, /*On fail goto*//*Label 83*/ GIMT_Encode4(1055), // Rule ID 37 //
1532 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule25Enabled),
1533 // Combiner Rule #25: constant_fold_binop; wip_match_opcode 'G_MUL'
1534 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner24),
1535 // Label 83: @1055
1536 GIM_Try, /*On fail goto*//*Label 84*/ GIMT_Encode4(1066), // Rule ID 88 //
1537 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule50Enabled),
1538 // Combiner Rule #50: undef_to_int_zero; wip_match_opcode 'G_MUL'
1539 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner39),
1540 // Label 84: @1066
1541 GIM_Try, /*On fail goto*//*Label 85*/ GIMT_Encode4(1077), // Rule ID 113 //
1542 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
1543 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_MUL'
1544 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
1545 // Label 85: @1077
1546 GIM_Try, /*On fail goto*//*Label 86*/ GIMT_Encode4(1088), // Rule ID 142 //
1547 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule67Enabled),
1548 // Combiner Rule #67: combine_mul_cmlt; wip_match_opcode 'G_MUL'
1549 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner55),
1550 // Label 86: @1088
1551 GIM_Try, /*On fail goto*//*Label 87*/ GIMT_Encode4(1111), // Rule ID 65 //
1552 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule31Enabled),
1553 // MIs[0] dst
1554 // No operand predicates
1555 // MIs[0] lhs
1556 // No operand predicates
1557 // MIs[0] zero
1558 GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 0,
1559 GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/2,
1560 // Combiner Rule #31: binop_right_to_zero
1561 GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/2,
1562 GIR_EraseRootFromParent_Done,
1563 // Label 87: @1111
1564 GIM_Try, /*On fail goto*//*Label 88*/ GIMT_Encode4(1134), // Rule ID 70 //
1565 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule36Enabled),
1566 // MIs[0] dst
1567 // No operand predicates
1568 // MIs[0] x
1569 // No operand predicates
1570 // MIs[0] Operand 2
1571 GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 1,
1572 GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
1573 // Combiner Rule #36: right_identity_one_int
1574 GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
1575 GIR_EraseRootFromParent_Done,
1576 // Label 88: @1134
1577 GIM_Reject,
1578 // Label 4: @1135
1579 GIM_Try, /*On fail goto*//*Label 89*/ GIMT_Encode4(1146), // Rule ID 61 //
1580 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule30Enabled),
1581 // Combiner Rule #30: binop_left_to_zero; wip_match_opcode 'G_SDIV'
1582 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner27),
1583 // Label 89: @1146
1584 GIM_Reject,
1585 // Label 5: @1147
1586 GIM_Try, /*On fail goto*//*Label 90*/ GIMT_Encode4(1158), // Rule ID 62 //
1587 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule30Enabled),
1588 // Combiner Rule #30: binop_left_to_zero; wip_match_opcode 'G_UDIV'
1589 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner27),
1590 // Label 90: @1158
1591 GIM_Try, /*On fail goto*//*Label 91*/ GIMT_Encode4(1169), // Rule ID 91 //
1592 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule52Enabled),
1593 // Combiner Rule #52: binop_left_undef_to_zero; wip_match_opcode 'G_UDIV'
1594 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner41),
1595 // Label 91: @1169
1596 GIM_Reject,
1597 // Label 6: @1170
1598 GIM_Try, /*On fail goto*//*Label 92*/ GIMT_Encode4(1181), // Rule ID 63 //
1599 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule30Enabled),
1600 // Combiner Rule #30: binop_left_to_zero; wip_match_opcode 'G_SREM'
1601 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner27),
1602 // Label 92: @1181
1603 GIM_Reject,
1604 // Label 7: @1182
1605 GIM_Try, /*On fail goto*//*Label 93*/ GIMT_Encode4(1193), // Rule ID 64 //
1606 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule30Enabled),
1607 // Combiner Rule #30: binop_left_to_zero; wip_match_opcode 'G_UREM'
1608 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner27),
1609 // Label 93: @1193
1610 GIM_Try, /*On fail goto*//*Label 94*/ GIMT_Encode4(1204), // Rule ID 92 //
1611 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule52Enabled),
1612 // Combiner Rule #52: binop_left_undef_to_zero; wip_match_opcode 'G_UREM'
1613 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner41),
1614 // Label 94: @1204
1615 GIM_Reject,
1616 // Label 8: @1205
1617 GIM_Try, /*On fail goto*//*Label 95*/ GIMT_Encode4(1216), // Rule ID 4 //
1618 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule2Enabled),
1619 // Combiner Rule #2: load_and_mask; wip_match_opcode 'G_AND'
1620 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner2),
1621 // Label 95: @1216
1622 GIM_Try, /*On fail goto*//*Label 96*/ GIMT_Encode4(1227), // Rule ID 11 //
1623 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule6Enabled),
1624 // Combiner Rule #6: hoist_logic_op_with_same_opcode_hands; wip_match_opcode 'G_AND'
1625 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner6),
1626 // Label 96: @1227
1627 GIM_Try, /*On fail goto*//*Label 97*/ GIMT_Encode4(1238), // Rule ID 14 //
1628 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule7Enabled),
1629 // Combiner Rule #7: redundant_and; wip_match_opcode 'G_AND'
1630 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner7),
1631 // Label 97: @1238
1632 GIM_Try, /*On fail goto*//*Label 98*/ GIMT_Encode4(1249), // Rule ID 38 //
1633 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule25Enabled),
1634 // Combiner Rule #25: constant_fold_binop; wip_match_opcode 'G_AND'
1635 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner24),
1636 // Label 98: @1249
1637 GIM_Try, /*On fail goto*//*Label 99*/ GIMT_Encode4(1260), // Rule ID 83 //
1638 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule47Enabled),
1639 // Combiner Rule #47: overlapping_and; wip_match_opcode 'G_AND'
1640 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner36),
1641 // Label 99: @1260
1642 GIM_Try, /*On fail goto*//*Label 100*/ GIMT_Encode4(1271), // Rule ID 87 //
1643 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule50Enabled),
1644 // Combiner Rule #50: undef_to_int_zero; wip_match_opcode 'G_AND'
1645 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner39),
1646 // Label 100: @1271
1647 GIM_Try, /*On fail goto*//*Label 101*/ GIMT_Encode4(1282), // Rule ID 114 //
1648 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
1649 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_AND'
1650 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
1651 // Label 101: @1282
1652 GIM_Try, /*On fail goto*//*Label 102*/ GIMT_Encode4(1319), // Rule ID 21 //
1653 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule14Enabled),
1654 // MIs[0] root
1655 // No operand predicates
1656 // MIs[0] shift
1657 GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
1658 GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_LSHR),
1659 // MIs[1] x
1660 // No operand predicates
1661 // MIs[1] lsb
1662 GIM_RecordInsnIgnoreCopies, /*DefineMI*/2, /*MI*/1, /*OpIdx*/2, // MIs[2]
1663 GIM_CheckOpcode, /*MI*/2, GIMT_Encode2(TargetOpcode::G_CONSTANT),
1664 // MIs[2] imm1
1665 // No operand predicates
1666 // MIs[0] mask
1667 GIM_RecordInsnIgnoreCopies, /*DefineMI*/3, /*MI*/0, /*OpIdx*/2, // MIs[3]
1668 GIM_CheckOpcode, /*MI*/3, GIMT_Encode2(TargetOpcode::G_CONSTANT),
1669 // MIs[3] imm2
1670 // No operand predicates
1671 GIM_CheckIsSafeToFold, /*NumInsns*/3,
1672 // Combiner Rule #14: bitfield_extract_from_and
1673 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner14),
1674 // Label 102: @1319
1675 GIM_Try, /*On fail goto*//*Label 103*/ GIMT_Encode4(1343), // Rule ID 59 //
1676 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule29Enabled),
1677 // MIs[0] dst
1678 // No operand predicates
1679 // MIs[0] src
1680 // No operand predicates
1681 // MIs[0] src
1682 GIM_CheckIsSameOperandIgnoreCopies, /*MI*/0, /*OpIdx*/2, /*OtherMI*/0, /*OtherOpIdx*/1,
1683 GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
1684 // Combiner Rule #29: binop_same_val @ [__binop_same_val_match_0[0]]
1685 GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
1686 GIR_EraseRootFromParent_Done,
1687 // Label 103: @1343
1688 GIM_Reject,
1689 // Label 9: @1344
1690 GIM_Try, /*On fail goto*//*Label 104*/ GIMT_Encode4(1355), // Rule ID 12 //
1691 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule6Enabled),
1692 // Combiner Rule #6: hoist_logic_op_with_same_opcode_hands; wip_match_opcode 'G_OR'
1693 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner6),
1694 // Label 104: @1355
1695 GIM_Try, /*On fail goto*//*Label 105*/ GIMT_Encode4(1366), // Rule ID 17 //
1696 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule10Enabled),
1697 // Combiner Rule #10: redundant_or; wip_match_opcode 'G_OR'
1698 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner10),
1699 // Label 105: @1366
1700 GIM_Try, /*On fail goto*//*Label 106*/ GIMT_Encode4(1377), // Rule ID 39 //
1701 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule25Enabled),
1702 // Combiner Rule #25: constant_fold_binop; wip_match_opcode 'G_OR'
1703 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner24),
1704 // Label 106: @1377
1705 GIM_Try, /*On fail goto*//*Label 107*/ GIMT_Encode4(1388), // Rule ID 89 //
1706 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule51Enabled),
1707 // Combiner Rule #51: undef_to_negative_one; wip_match_opcode 'G_OR'
1708 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner40),
1709 // Label 107: @1388
1710 GIM_Try, /*On fail goto*//*Label 108*/ GIMT_Encode4(1399), // Rule ID 110 //
1711 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule62Enabled),
1712 // Combiner Rule #62: or_to_bsp; wip_match_opcode 'G_OR'
1713 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner50),
1714 // Label 108: @1399
1715 GIM_Try, /*On fail goto*//*Label 109*/ GIMT_Encode4(1410), // Rule ID 115 //
1716 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
1717 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_OR'
1718 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
1719 // Label 109: @1410
1720 GIM_Try, /*On fail goto*//*Label 110*/ GIMT_Encode4(1434), // Rule ID 60 //
1721 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule29Enabled),
1722 // MIs[0] dst
1723 // No operand predicates
1724 // MIs[0] src
1725 // No operand predicates
1726 // MIs[0] src
1727 GIM_CheckIsSameOperandIgnoreCopies, /*MI*/0, /*OpIdx*/2, /*OtherMI*/0, /*OtherOpIdx*/1,
1728 GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
1729 // Combiner Rule #29: binop_same_val @ [__binop_same_val_match_0[1]]
1730 GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
1731 GIR_EraseRootFromParent_Done,
1732 // Label 110: @1434
1733 GIM_Try, /*On fail goto*//*Label 111*/ GIMT_Encode4(1457), // Rule ID 51 //
1734 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule28Enabled),
1735 // MIs[0] dst
1736 // No operand predicates
1737 // MIs[0] lhs
1738 // No operand predicates
1739 // MIs[0] Operand 2
1740 GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 0,
1741 GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
1742 // Combiner Rule #28: right_identity_zero @ [__right_identity_zero_match_0[2]]
1743 GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
1744 GIR_EraseRootFromParent_Done,
1745 // Label 111: @1457
1746 GIM_Reject,
1747 // Label 10: @1458
1748 GIM_Try, /*On fail goto*//*Label 112*/ GIMT_Encode4(1469), // Rule ID 13 //
1749 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule6Enabled),
1750 // Combiner Rule #6: hoist_logic_op_with_same_opcode_hands; wip_match_opcode 'G_XOR'
1751 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner6),
1752 // Label 112: @1469
1753 GIM_Try, /*On fail goto*//*Label 113*/ GIMT_Encode4(1480), // Rule ID 15 //
1754 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule8Enabled),
1755 // Combiner Rule #8: xor_of_and_with_same_reg; wip_match_opcode 'G_XOR'
1756 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner8),
1757 // Label 113: @1480
1758 GIM_Try, /*On fail goto*//*Label 114*/ GIMT_Encode4(1491), // Rule ID 40 //
1759 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule25Enabled),
1760 // Combiner Rule #25: constant_fold_binop; wip_match_opcode 'G_XOR'
1761 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner24),
1762 // Label 114: @1491
1763 GIM_Try, /*On fail goto*//*Label 115*/ GIMT_Encode4(1502), // Rule ID 101 //
1764 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule55Enabled),
1765 // Combiner Rule #55: propagate_undef_any_op; wip_match_opcode 'G_XOR'
1766 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner43),
1767 // Label 115: @1502
1768 GIM_Try, /*On fail goto*//*Label 116*/ GIMT_Encode4(1513), // Rule ID 116 //
1769 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
1770 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_XOR'
1771 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
1772 // Label 116: @1513
1773 GIM_Try, /*On fail goto*//*Label 117*/ GIMT_Encode4(1536), // Rule ID 52 //
1774 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule28Enabled),
1775 // MIs[0] dst
1776 // No operand predicates
1777 // MIs[0] lhs
1778 // No operand predicates
1779 // MIs[0] Operand 2
1780 GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 0,
1781 GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
1782 // Combiner Rule #28: right_identity_zero @ [__right_identity_zero_match_0[3]]
1783 GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
1784 GIR_EraseRootFromParent_Done,
1785 // Label 117: @1536
1786 GIM_Reject,
1787 // Label 11: @1537
1788 GIM_Try, /*On fail goto*//*Label 118*/ GIMT_Encode4(1548), // Rule ID 106 //
1789 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule59Enabled),
1790 // Combiner Rule #59: unmerge_undef; wip_match_opcode 'G_UNMERGE_VALUES'
1791 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner47),
1792 // Label 118: @1548
1793 GIM_Reject,
1794 // Label 12: @1549
1795 GIM_Try, /*On fail goto*//*Label 119*/ GIMT_Encode4(1560), // Rule ID 29 //
1796 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule19Enabled),
1797 // Combiner Rule #19: merge_unmerge; wip_match_opcode 'G_MERGE_VALUES'
1798 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner19),
1799 // Label 119: @1560
1800 GIM_Try, /*On fail goto*//*Label 120*/ GIMT_Encode4(1571), // Rule ID 34 //
1801 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule24Enabled),
1802 // Combiner Rule #24: fold_merge_to_zext; wip_match_opcode 'G_MERGE_VALUES'
1803 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner23),
1804 // Label 120: @1571
1805 GIM_Reject,
1806 // Label 13: @1572
1807 GIM_Try, /*On fail goto*//*Label 121*/ GIMT_Encode4(1583), // Rule ID 75 //
1808 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule39Enabled),
1809 // Combiner Rule #39: buildvector_identity_fold; wip_match_opcode 'G_BUILD_VECTOR'
1810 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner31),
1811 // Label 121: @1583
1812 GIM_Reject,
1813 // Label 14: @1584
1814 GIM_Try, /*On fail goto*//*Label 122*/ GIMT_Encode4(1595), // Rule ID 74 //
1815 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule39Enabled),
1816 // Combiner Rule #39: buildvector_identity_fold; wip_match_opcode 'G_BUILD_VECTOR_TRUNC'
1817 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner31),
1818 // Label 122: @1595
1819 GIM_Reject,
1820 // Label 15: @1596
1821 GIM_Try, /*On fail goto*//*Label 123*/ GIMT_Encode4(1607), // Rule ID 111 //
1822 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule63Enabled),
1823 // Combiner Rule #63: combine_concat_vector; wip_match_opcode 'G_CONCAT_VECTORS'
1824 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner51),
1825 // Label 123: @1607
1826 GIM_Reject,
1827 // Label 16: @1608
1828 GIM_Try, /*On fail goto*//*Label 124*/ GIMT_Encode4(1629), // Rule ID 67 //
1829 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule33Enabled),
1830 // MIs[0] dst
1831 // No operand predicates
1832 // MIs[0] t
1833 GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
1834 GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_INTTOPTR),
1835 // MIs[1] ptr
1836 // No operand predicates
1837 GIM_CheckIsSafeToFold, /*NumInsns*/1,
1838 // Combiner Rule #33: i2p_to_p2i
1839 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner29),
1840 // Label 124: @1629
1841 GIM_Reject,
1842 // Label 17: @1630
1843 GIM_Try, /*On fail goto*//*Label 125*/ GIMT_Encode4(1641), // Rule ID 66 //
1844 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule32Enabled),
1845 // Combiner Rule #32: p2i_to_i2p; wip_match_opcode 'G_INTTOPTR'
1846 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner28),
1847 // Label 125: @1641
1848 GIM_Reject,
1849 // Label 18: @1642
1850 GIM_Try, /*On fail goto*//*Label 126*/ GIMT_Encode4(1663), // Rule ID 78 //
1851 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule42Enabled),
1852 // MIs[0] dst
1853 // No operand predicates
1854 // MIs[0] src1
1855 GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
1856 GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_BITCAST),
1857 // MIs[1] src0
1858 // No operand predicates
1859 GIM_CheckIsSafeToFold, /*NumInsns*/1,
1860 // Combiner Rule #42: bitcast_bitcast_fold
1861 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner34),
1862 // Label 126: @1663
1863 GIM_Reject,
1864 // Label 19: @1664
1865 GIM_Try, /*On fail goto*//*Label 127*/ GIMT_Encode4(1675), // Rule ID 141 //
1866 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule66Enabled),
1867 // MIs[0] dst
1868 // No operand predicates
1869 // MIs[0] src
1870 // No operand predicates
1871 // Combiner Rule #66: push_freeze_to_prevent_poison_from_propagating
1872 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner54),
1873 // Label 127: @1675
1874 GIM_Reject,
1875 // Label 20: @1676
1876 GIM_Try, /*On fail goto*//*Label 128*/ GIMT_Encode4(1687), // Rule ID 1 //
1877 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule1Enabled),
1878 // Combiner Rule #1: extending_loads; wip_match_opcode 'G_LOAD'
1879 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner1),
1880 // Label 128: @1687
1881 GIM_Try, /*On fail goto*//*Label 129*/ GIMT_Encode4(1698), // Rule ID 5 //
1882 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule3Enabled),
1883 // Combiner Rule #3: combine_indexed_load_store; wip_match_opcode 'G_LOAD'
1884 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner3),
1885 // Label 129: @1698
1886 GIM_Reject,
1887 // Label 21: @1699
1888 GIM_Try, /*On fail goto*//*Label 130*/ GIMT_Encode4(1710), // Rule ID 2 //
1889 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule1Enabled),
1890 // Combiner Rule #1: extending_loads; wip_match_opcode 'G_SEXTLOAD'
1891 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner1),
1892 // Label 130: @1710
1893 GIM_Try, /*On fail goto*//*Label 131*/ GIMT_Encode4(1721), // Rule ID 6 //
1894 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule3Enabled),
1895 // Combiner Rule #3: combine_indexed_load_store; wip_match_opcode 'G_SEXTLOAD'
1896 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner3),
1897 // Label 131: @1721
1898 GIM_Reject,
1899 // Label 22: @1722
1900 GIM_Try, /*On fail goto*//*Label 132*/ GIMT_Encode4(1733), // Rule ID 3 //
1901 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule1Enabled),
1902 // Combiner Rule #1: extending_loads; wip_match_opcode 'G_ZEXTLOAD'
1903 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner1),
1904 // Label 132: @1733
1905 GIM_Try, /*On fail goto*//*Label 133*/ GIMT_Encode4(1744), // Rule ID 7 //
1906 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule3Enabled),
1907 // Combiner Rule #3: combine_indexed_load_store; wip_match_opcode 'G_ZEXTLOAD'
1908 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner3),
1909 // Label 133: @1744
1910 GIM_Reject,
1911 // Label 23: @1745
1912 GIM_Try, /*On fail goto*//*Label 134*/ GIMT_Encode4(1756), // Rule ID 8 //
1913 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule3Enabled),
1914 // Combiner Rule #3: combine_indexed_load_store; wip_match_opcode 'G_STORE'
1915 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner3),
1916 // Label 134: @1756
1917 GIM_Try, /*On fail goto*//*Label 135*/ GIMT_Encode4(1767), // Rule ID 84 //
1918 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule48Enabled),
1919 // Combiner Rule #48: split_store_zero_128; wip_match_opcode 'G_STORE'
1920 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner37),
1921 // Label 135: @1767
1922 GIM_Try, /*On fail goto*//*Label 136*/ GIMT_Encode4(1778), // Rule ID 105 //
1923 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule58Enabled),
1924 // Combiner Rule #58: erase_undef_store; wip_match_opcode 'G_STORE'
1925 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner46),
1926 // Label 136: @1778
1927 GIM_Reject,
1928 // Label 24: @1779
1929 GIM_Try, /*On fail goto*//*Label 137*/ GIMT_Encode4(1790), // Rule ID 10 //
1930 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule5Enabled),
1931 // Combiner Rule #5: mutate_anyext_to_zext; wip_match_opcode 'G_ANYEXT'
1932 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner5),
1933 // Label 137: @1790
1934 GIM_Try, /*On fail goto*//*Label 138*/ GIMT_Encode4(1801), // Rule ID 68 //
1935 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule34Enabled),
1936 // Combiner Rule #34: anyext_trunc_fold; wip_match_opcode 'G_ANYEXT'
1937 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner30),
1938 // Label 138: @1801
1939 GIM_Reject,
1940 // Label 25: @1802
1941 GIM_Try, /*On fail goto*//*Label 139*/ GIMT_Encode4(1813), // Rule ID 76 //
1942 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule40Enabled),
1943 // Combiner Rule #40: trunc_buildvector_fold; wip_match_opcode 'G_TRUNC'
1944 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner32),
1945 // Label 139: @1813
1946 GIM_Try, /*On fail goto*//*Label 140*/ GIMT_Encode4(1824), // Rule ID 77 //
1947 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule41Enabled),
1948 // Combiner Rule #41: trunc_lshr_buildvector_fold; wip_match_opcode 'G_TRUNC'
1949 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner33),
1950 // Label 140: @1824
1951 GIM_Try, /*On fail goto*//*Label 141*/ GIMT_Encode4(1835), // Rule ID 102 //
1952 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule55Enabled),
1953 // Combiner Rule #55: propagate_undef_any_op; wip_match_opcode 'G_TRUNC'
1954 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner43),
1955 // Label 141: @1835
1956 GIM_Reject,
1957 // Label 26: @1836
1958 GIM_Try, /*On fail goto*//*Label 142*/ GIMT_Encode4(1847), // Rule ID 9 //
1959 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule4Enabled),
1960 // Combiner Rule #4: sext_trunc_sextload; wip_match_opcode 'G_SEXT_INREG'
1961 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner4),
1962 // Label 142: @1847
1963 GIM_Try, /*On fail goto*//*Label 143*/ GIMT_Encode4(1858), // Rule ID 19 //
1964 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule12Enabled),
1965 // Combiner Rule #12: redundant_sext_inreg; wip_match_opcode 'G_SEXT_INREG'
1966 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner12),
1967 // Label 143: @1858
1968 GIM_Try, /*On fail goto*//*Label 144*/ GIMT_Encode4(1869), // Rule ID 20 //
1969 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule13Enabled),
1970 // Combiner Rule #13: bitfield_extract_from_sext_inreg; wip_match_opcode 'G_SEXT_INREG'
1971 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner13),
1972 // Label 144: @1869
1973 GIM_Reject,
1974 // Label 27: @1870
1975 GIM_Try, /*On fail goto*//*Label 145*/ GIMT_Encode4(1881), // Rule ID 41 //
1976 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule25Enabled),
1977 // Combiner Rule #25: constant_fold_binop; wip_match_opcode 'G_SHL'
1978 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner24),
1979 // Label 145: @1881
1980 GIM_Try, /*On fail goto*//*Label 146*/ GIMT_Encode4(1892), // Rule ID 90 //
1981 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule52Enabled),
1982 // Combiner Rule #52: binop_left_undef_to_zero; wip_match_opcode 'G_SHL'
1983 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner41),
1984 // Label 146: @1892
1985 GIM_Try, /*On fail goto*//*Label 147*/ GIMT_Encode4(1903), // Rule ID 93 //
1986 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule53Enabled),
1987 // Combiner Rule #53: binop_right_undef_to_undef; wip_match_opcode 'G_SHL'
1988 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner42),
1989 // Label 147: @1903
1990 GIM_Try, /*On fail goto*//*Label 148*/ GIMT_Encode4(1926), // Rule ID 53 //
1991 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule28Enabled),
1992 // MIs[0] dst
1993 // No operand predicates
1994 // MIs[0] lhs
1995 // No operand predicates
1996 // MIs[0] Operand 2
1997 GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 0,
1998 GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
1999 // Combiner Rule #28: right_identity_zero @ [__right_identity_zero_match_0[4]]
2000 GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
2001 GIR_EraseRootFromParent_Done,
2002 // Label 148: @1926
2003 GIM_Reject,
2004 // Label 28: @1927
2005 GIM_Try, /*On fail goto*//*Label 149*/ GIMT_Encode4(1938), // Rule ID 23 //
2006 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule15Enabled),
2007 // Combiner Rule #15: bitfield_extract_from_shr; wip_match_opcode 'G_LSHR'
2008 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner15),
2009 // Label 149: @1938
2010 GIM_Try, /*On fail goto*//*Label 150*/ GIMT_Encode4(1949), // Rule ID 25 //
2011 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule16Enabled),
2012 // Combiner Rule #16: bitfield_extract_from_shr_and; wip_match_opcode 'G_LSHR'
2013 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner16),
2014 // Label 150: @1949
2015 GIM_Try, /*On fail goto*//*Label 151*/ GIMT_Encode4(1960), // Rule ID 42 //
2016 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule25Enabled),
2017 // Combiner Rule #25: constant_fold_binop; wip_match_opcode 'G_LSHR'
2018 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner24),
2019 // Label 151: @1960
2020 GIM_Try, /*On fail goto*//*Label 152*/ GIMT_Encode4(1971), // Rule ID 95 //
2021 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule53Enabled),
2022 // Combiner Rule #53: binop_right_undef_to_undef; wip_match_opcode 'G_LSHR'
2023 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner42),
2024 // Label 152: @1971
2025 GIM_Try, /*On fail goto*//*Label 153*/ GIMT_Encode4(1994), // Rule ID 55 //
2026 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule28Enabled),
2027 // MIs[0] dst
2028 // No operand predicates
2029 // MIs[0] lhs
2030 // No operand predicates
2031 // MIs[0] Operand 2
2032 GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 0,
2033 GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
2034 // Combiner Rule #28: right_identity_zero @ [__right_identity_zero_match_0[6]]
2035 GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
2036 GIR_EraseRootFromParent_Done,
2037 // Label 153: @1994
2038 GIM_Reject,
2039 // Label 29: @1995
2040 GIM_Try, /*On fail goto*//*Label 154*/ GIMT_Encode4(2006), // Rule ID 22 //
2041 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule15Enabled),
2042 // Combiner Rule #15: bitfield_extract_from_shr; wip_match_opcode 'G_ASHR'
2043 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner15),
2044 // Label 154: @2006
2045 GIM_Try, /*On fail goto*//*Label 155*/ GIMT_Encode4(2017), // Rule ID 24 //
2046 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule16Enabled),
2047 // Combiner Rule #16: bitfield_extract_from_shr_and; wip_match_opcode 'G_ASHR'
2048 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner16),
2049 // Label 155: @2017
2050 GIM_Try, /*On fail goto*//*Label 156*/ GIMT_Encode4(2028), // Rule ID 43 //
2051 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule25Enabled),
2052 // Combiner Rule #25: constant_fold_binop; wip_match_opcode 'G_ASHR'
2053 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner24),
2054 // Label 156: @2028
2055 GIM_Try, /*On fail goto*//*Label 157*/ GIMT_Encode4(2039), // Rule ID 94 //
2056 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule53Enabled),
2057 // Combiner Rule #53: binop_right_undef_to_undef; wip_match_opcode 'G_ASHR'
2058 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner42),
2059 // Label 157: @2039
2060 GIM_Try, /*On fail goto*//*Label 158*/ GIMT_Encode4(2062), // Rule ID 54 //
2061 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule28Enabled),
2062 // MIs[0] dst
2063 // No operand predicates
2064 // MIs[0] lhs
2065 // No operand predicates
2066 // MIs[0] Operand 2
2067 GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 0,
2068 GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
2069 // Combiner Rule #28: right_identity_zero @ [__right_identity_zero_match_0[5]]
2070 GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
2071 GIR_EraseRootFromParent_Done,
2072 // Label 158: @2062
2073 GIM_Reject,
2074 // Label 30: @2063
2075 GIM_Try, /*On fail goto*//*Label 159*/ GIMT_Encode4(2074), // Rule ID 26 //
2076 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule17Enabled),
2077 // Combiner Rule #17: rotate_out_of_range; wip_match_opcode 'G_ROTR'
2078 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner17),
2079 // Label 159: @2074
2080 GIM_Try, /*On fail goto*//*Label 160*/ GIMT_Encode4(2097), // Rule ID 58 //
2081 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule28Enabled),
2082 // MIs[0] dst
2083 // No operand predicates
2084 // MIs[0] lhs
2085 // No operand predicates
2086 // MIs[0] Operand 2
2087 GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 0,
2088 GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
2089 // Combiner Rule #28: right_identity_zero @ [__right_identity_zero_match_0[9]]
2090 GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
2091 GIR_EraseRootFromParent_Done,
2092 // Label 160: @2097
2093 GIM_Reject,
2094 // Label 31: @2098
2095 GIM_Try, /*On fail goto*//*Label 161*/ GIMT_Encode4(2109), // Rule ID 27 //
2096 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule17Enabled),
2097 // Combiner Rule #17: rotate_out_of_range; wip_match_opcode 'G_ROTL'
2098 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner17),
2099 // Label 161: @2109
2100 GIM_Try, /*On fail goto*//*Label 162*/ GIMT_Encode4(2132), // Rule ID 57 //
2101 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule28Enabled),
2102 // MIs[0] dst
2103 // No operand predicates
2104 // MIs[0] lhs
2105 // No operand predicates
2106 // MIs[0] Operand 2
2107 GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 0,
2108 GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
2109 // Combiner Rule #28: right_identity_zero @ [__right_identity_zero_match_0[8]]
2110 GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
2111 GIR_EraseRootFromParent_Done,
2112 // Label 162: @2132
2113 GIM_Reject,
2114 // Label 32: @2133
2115 GIM_Try, /*On fail goto*//*Label 163*/ GIMT_Encode4(2144), // Rule ID 28 //
2116 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule18Enabled),
2117 // Combiner Rule #18: icmp_to_true_false_known_bits; wip_match_opcode 'G_ICMP'
2118 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner18),
2119 // Label 163: @2144
2120 GIM_Reject,
2121 // Label 33: @2145
2122 GIM_Try, /*On fail goto*//*Label 164*/ GIMT_Encode4(2156), // Rule ID 31 //
2123 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule21Enabled),
2124 // Combiner Rule #21: select_constant_cmp; wip_match_opcode 'G_SELECT'
2125 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner20),
2126 // Label 164: @2156
2127 GIM_Try, /*On fail goto*//*Label 165*/ GIMT_Encode4(2167), // Rule ID 33 //
2128 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule23Enabled),
2129 // Combiner Rule #23: match_selects; wip_match_opcode 'G_SELECT'
2130 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner22),
2131 // Label 165: @2167
2132 GIM_Try, /*On fail goto*//*Label 166*/ GIMT_Encode4(2178), // Rule ID 48 //
2133 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule27Enabled),
2134 // Combiner Rule #27: select_same_val; wip_match_opcode 'G_SELECT'
2135 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner26),
2136 // Label 166: @2178
2137 GIM_Try, /*On fail goto*//*Label 167*/ GIMT_Encode4(2189), // Rule ID 109 //
2138 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule61Enabled),
2139 // Combiner Rule #61: select_to_minmax; wip_match_opcode 'G_SELECT'
2140 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner49),
2141 // Label 167: @2189
2142 GIM_Try, /*On fail goto*//*Label 168*/ GIMT_Encode4(2210), // Rule ID 32 //
2143 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule22Enabled),
2144 // MIs[0] root
2145 // No operand predicates
2146 // MIs[0] tst
2147 GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
2148 GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_ICMP),
2149 // MIs[1] tst1
2150 // No operand predicates
2151 // MIs[1] a
2152 // No operand predicates
2153 // MIs[1] b
2154 // No operand predicates
2155 // MIs[0] x
2156 // No operand predicates
2157 // MIs[0] y
2158 // No operand predicates
2159 GIM_CheckIsSafeToFold, /*NumInsns*/1,
2160 // Combiner Rule #22: select_to_iminmax
2161 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner21),
2162 // Label 168: @2210
2163 GIM_Try, /*On fail goto*//*Label 169*/ GIMT_Encode4(2239), // Rule ID 30 //
2164 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule20Enabled),
2165 // MIs[0] dst
2166 // No operand predicates
2167 // MIs[0] undef
2168 GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
2169 GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_IMPLICIT_DEF),
2170 // MIs[0] x
2171 // No operand predicates
2172 // MIs[0] y
2173 // No operand predicates
2174 GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/3,
2175 GIM_CheckIsSafeToFold, /*NumInsns*/1,
2176 // Combiner Rule #20: select_undef_cmp
2177 GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/3,
2178 GIR_EraseRootFromParent_Done,
2179 // Label 169: @2239
2180 GIM_Reject,
2181 // Label 34: @2240
2182 GIM_Try, /*On fail goto*//*Label 170*/ GIMT_Encode4(2251), // Rule ID 121 //
2183 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
2184 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_UADDO'
2185 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
2186 // Label 170: @2251
2187 GIM_Reject,
2188 // Label 35: @2252
2189 GIM_Try, /*On fail goto*//*Label 171*/ GIMT_Encode4(2263), // Rule ID 122 //
2190 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
2191 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_SADDO'
2192 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
2193 // Label 171: @2263
2194 GIM_Reject,
2195 // Label 36: @2264
2196 GIM_Try, /*On fail goto*//*Label 172*/ GIMT_Encode4(2275), // Rule ID 123 //
2197 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
2198 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_UMULO'
2199 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
2200 // Label 172: @2275
2201 GIM_Reject,
2202 // Label 37: @2276
2203 GIM_Try, /*On fail goto*//*Label 173*/ GIMT_Encode4(2287), // Rule ID 124 //
2204 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
2205 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_SMULO'
2206 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
2207 // Label 173: @2287
2208 GIM_Reject,
2209 // Label 38: @2288
2210 GIM_Try, /*On fail goto*//*Label 174*/ GIMT_Encode4(2299), // Rule ID 125 //
2211 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
2212 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_UMULH'
2213 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
2214 // Label 174: @2299
2215 GIM_Reject,
2216 // Label 39: @2300
2217 GIM_Try, /*On fail goto*//*Label 175*/ GIMT_Encode4(2311), // Rule ID 126 //
2218 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
2219 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_SMULH'
2220 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
2221 // Label 175: @2311
2222 GIM_Reject,
2223 // Label 40: @2312
2224 GIM_Try, /*On fail goto*//*Label 176*/ GIMT_Encode4(2323), // Rule ID 127 //
2225 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
2226 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_UADDSAT'
2227 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
2228 // Label 176: @2323
2229 GIM_Reject,
2230 // Label 41: @2324
2231 GIM_Try, /*On fail goto*//*Label 177*/ GIMT_Encode4(2335), // Rule ID 128 //
2232 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
2233 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_SADDSAT'
2234 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
2235 // Label 177: @2335
2236 GIM_Reject,
2237 // Label 42: @2336
2238 GIM_Try, /*On fail goto*//*Label 178*/ GIMT_Encode4(2347), // Rule ID 129 //
2239 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
2240 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_SMULFIX'
2241 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
2242 // Label 178: @2347
2243 GIM_Reject,
2244 // Label 43: @2348
2245 GIM_Try, /*On fail goto*//*Label 179*/ GIMT_Encode4(2359), // Rule ID 130 //
2246 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
2247 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_UMULFIX'
2248 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
2249 // Label 179: @2359
2250 GIM_Reject,
2251 // Label 44: @2360
2252 GIM_Try, /*On fail goto*//*Label 180*/ GIMT_Encode4(2371), // Rule ID 131 //
2253 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
2254 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_SMULFIXSAT'
2255 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
2256 // Label 180: @2371
2257 GIM_Reject,
2258 // Label 45: @2372
2259 GIM_Try, /*On fail goto*//*Label 181*/ GIMT_Encode4(2383), // Rule ID 132 //
2260 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
2261 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_UMULFIXSAT'
2262 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
2263 // Label 181: @2383
2264 GIM_Reject,
2265 // Label 46: @2384
2266 GIM_Try, /*On fail goto*//*Label 182*/ GIMT_Encode4(2395), // Rule ID 44 //
2267 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule26Enabled),
2268 // Combiner Rule #26: constant_fold_fp_binop; wip_match_opcode 'G_FADD'
2269 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner25),
2270 // Label 182: @2395
2271 GIM_Try, /*On fail goto*//*Label 183*/ GIMT_Encode4(2406), // Rule ID 133 //
2272 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule65Enabled),
2273 // Combiner Rule #65: commute_fp_constant_to_rhs; wip_match_opcode 'G_FADD'
2274 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner53),
2275 // Label 183: @2406
2276 GIM_Try, /*On fail goto*//*Label 184*/ GIMT_Encode4(2429), // Rule ID 80 //
2277 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule44Enabled),
2278 // MIs[0] dst
2279 // No operand predicates
2280 // MIs[0] x
2281 // No operand predicates
2282 // MIs[0] y
2283 // No operand predicates
2284 GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner1),
2285 GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
2286 // Combiner Rule #44: right_identity_neg_zero_fp
2287 GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
2288 GIR_EraseRootFromParent_Done,
2289 // Label 184: @2429
2290 GIM_Reject,
2291 // Label 47: @2430
2292 GIM_Try, /*On fail goto*//*Label 185*/ GIMT_Encode4(2441), // Rule ID 45 //
2293 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule26Enabled),
2294 // Combiner Rule #26: constant_fold_fp_binop; wip_match_opcode 'G_FSUB'
2295 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner25),
2296 // Label 185: @2441
2297 GIM_Reject,
2298 // Label 48: @2442
2299 GIM_Try, /*On fail goto*//*Label 186*/ GIMT_Encode4(2453), // Rule ID 46 //
2300 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule26Enabled),
2301 // Combiner Rule #26: constant_fold_fp_binop; wip_match_opcode 'G_FMUL'
2302 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner25),
2303 // Label 186: @2453
2304 GIM_Try, /*On fail goto*//*Label 187*/ GIMT_Encode4(2464), // Rule ID 134 //
2305 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule65Enabled),
2306 // Combiner Rule #65: commute_fp_constant_to_rhs; wip_match_opcode 'G_FMUL'
2307 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner53),
2308 // Label 187: @2464
2309 GIM_Try, /*On fail goto*//*Label 188*/ GIMT_Encode4(2487), // Rule ID 71 //
2310 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule37Enabled),
2311 // MIs[0] dst
2312 // No operand predicates
2313 // MIs[0] x
2314 // No operand predicates
2315 // MIs[0] y
2316 // No operand predicates
2317 GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner0),
2318 GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
2319 // Combiner Rule #37: right_identity_one_fp
2320 GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
2321 GIR_EraseRootFromParent_Done,
2322 // Label 188: @2487
2323 GIM_Try, /*On fail goto*//*Label 189*/ GIMT_Encode4(2507), // Rule ID 81 //
2324 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule45Enabled),
2325 // MIs[0] dst
2326 // No operand predicates
2327 // MIs[0] x
2328 // No operand predicates
2329 // MIs[0] y
2330 // No operand predicates
2331 GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner2),
2332 // Combiner Rule #45: right_identity_neg_one_fp
2333 GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(TargetOpcode::G_FNEG),
2334 GIR_RootToRootCopy, /*OpIdx*/0, // dst
2335 GIR_RootToRootCopy, /*OpIdx*/1, // x
2336 GIR_EraseRootFromParent_Done,
2337 // Label 189: @2507
2338 GIM_Reject,
2339 // Label 49: @2508
2340 GIM_Try, /*On fail goto*//*Label 190*/ GIMT_Encode4(2519), // Rule ID 47 //
2341 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule26Enabled),
2342 // Combiner Rule #26: constant_fold_fp_binop; wip_match_opcode 'G_FDIV'
2343 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner25),
2344 // Label 190: @2519
2345 GIM_Reject,
2346 // Label 50: @2520
2347 GIM_Try, /*On fail goto*//*Label 191*/ GIMT_Encode4(2549), // Rule ID 69 //
2348 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule35Enabled),
2349 // MIs[0] dst
2350 // No operand predicates
2351 // MIs[0] t
2352 GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
2353 GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_FNEG),
2354 // MIs[1] src
2355 // No operand predicates
2356 GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/1, /*NewOpIdx*/1,
2357 GIM_CheckIsSafeToFold, /*NumInsns*/1,
2358 // Combiner Rule #35: fneg_fneg_fold
2359 GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/1, /*NewOpIdx*/1,
2360 GIR_EraseRootFromParent_Done,
2361 // Label 191: @2549
2362 GIM_Reject,
2363 // Label 51: @2550
2364 GIM_Try, /*On fail goto*//*Label 192*/ GIMT_Encode4(2571), // Rule ID 79 //
2365 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule43Enabled),
2366 // MIs[0] dst
2367 // No operand predicates
2368 // MIs[0] src1
2369 GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
2370 GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_FPEXT),
2371 // MIs[1] src0
2372 // No operand predicates
2373 GIM_CheckIsSafeToFold, /*NumInsns*/1,
2374 // Combiner Rule #43: fptrunc_fpext_fold
2375 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner34),
2376 // Label 192: @2571
2377 GIM_Reject,
2378 // Label 52: @2572
2379 GIM_Try, /*On fail goto*//*Label 193*/ GIMT_Encode4(2583), // Rule ID 98 //
2380 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule55Enabled),
2381 // Combiner Rule #55: propagate_undef_any_op; wip_match_opcode 'G_FPTOSI'
2382 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner43),
2383 // Label 193: @2583
2384 GIM_Reject,
2385 // Label 53: @2584
2386 GIM_Try, /*On fail goto*//*Label 194*/ GIMT_Encode4(2595), // Rule ID 99 //
2387 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule55Enabled),
2388 // Combiner Rule #55: propagate_undef_any_op; wip_match_opcode 'G_FPTOUI'
2389 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner43),
2390 // Label 194: @2595
2391 GIM_Reject,
2392 // Label 54: @2596
2393 GIM_Try, /*On fail goto*//*Label 195*/ GIMT_Encode4(2607), // Rule ID 86 //
2394 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule49Enabled),
2395 // Combiner Rule #49: undef_to_fp_zero; wip_match_opcode 'G_SITOFP'
2396 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner38),
2397 // Label 195: @2607
2398 GIM_Reject,
2399 // Label 55: @2608
2400 GIM_Try, /*On fail goto*//*Label 196*/ GIMT_Encode4(2619), // Rule ID 85 //
2401 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule49Enabled),
2402 // Combiner Rule #49: undef_to_fp_zero; wip_match_opcode 'G_UITOFP'
2403 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner38),
2404 // Label 196: @2619
2405 GIM_Reject,
2406 // Label 56: @2620
2407 GIM_Try, /*On fail goto*//*Label 197*/ GIMT_Encode4(2631), // Rule ID 135 //
2408 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule65Enabled),
2409 // Combiner Rule #65: commute_fp_constant_to_rhs; wip_match_opcode 'G_FMINNUM'
2410 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner53),
2411 // Label 197: @2631
2412 GIM_Reject,
2413 // Label 57: @2632
2414 GIM_Try, /*On fail goto*//*Label 198*/ GIMT_Encode4(2643), // Rule ID 136 //
2415 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule65Enabled),
2416 // Combiner Rule #65: commute_fp_constant_to_rhs; wip_match_opcode 'G_FMAXNUM'
2417 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner53),
2418 // Label 198: @2643
2419 GIM_Reject,
2420 // Label 58: @2644
2421 GIM_Try, /*On fail goto*//*Label 199*/ GIMT_Encode4(2655), // Rule ID 137 //
2422 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule65Enabled),
2423 // Combiner Rule #65: commute_fp_constant_to_rhs; wip_match_opcode 'G_FMINNUM_IEEE'
2424 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner53),
2425 // Label 199: @2655
2426 GIM_Reject,
2427 // Label 59: @2656
2428 GIM_Try, /*On fail goto*//*Label 200*/ GIMT_Encode4(2667), // Rule ID 138 //
2429 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule65Enabled),
2430 // Combiner Rule #65: commute_fp_constant_to_rhs; wip_match_opcode 'G_FMAXNUM_IEEE'
2431 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner53),
2432 // Label 200: @2667
2433 GIM_Reject,
2434 // Label 60: @2668
2435 GIM_Try, /*On fail goto*//*Label 201*/ GIMT_Encode4(2679), // Rule ID 139 //
2436 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule65Enabled),
2437 // Combiner Rule #65: commute_fp_constant_to_rhs; wip_match_opcode 'G_FMINIMUM'
2438 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner53),
2439 // Label 201: @2679
2440 GIM_Reject,
2441 // Label 61: @2680
2442 GIM_Try, /*On fail goto*//*Label 202*/ GIMT_Encode4(2691), // Rule ID 140 //
2443 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule65Enabled),
2444 // Combiner Rule #65: commute_fp_constant_to_rhs; wip_match_opcode 'G_FMAXIMUM'
2445 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner53),
2446 // Label 202: @2691
2447 GIM_Reject,
2448 // Label 62: @2692
2449 GIM_Try, /*On fail goto*//*Label 203*/ GIMT_Encode4(2703), // Rule ID 82 //
2450 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule46Enabled),
2451 // Combiner Rule #46: ptr_add_immed_chain; wip_match_opcode 'G_PTR_ADD'
2452 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner35),
2453 // Label 203: @2703
2454 GIM_Try, /*On fail goto*//*Label 204*/ GIMT_Encode4(2726), // Rule ID 56 //
2455 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule28Enabled),
2456 // MIs[0] dst
2457 // No operand predicates
2458 // MIs[0] lhs
2459 // No operand predicates
2460 // MIs[0] Operand 2
2461 GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 0,
2462 GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
2463 // Combiner Rule #28: right_identity_zero @ [__right_identity_zero_match_0[7]]
2464 GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
2465 GIR_EraseRootFromParent_Done,
2466 // Label 204: @2726
2467 GIM_Reject,
2468 // Label 63: @2727
2469 GIM_Try, /*On fail goto*//*Label 205*/ GIMT_Encode4(2738), // Rule ID 117 //
2470 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
2471 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_SMIN'
2472 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
2473 // Label 205: @2738
2474 GIM_Reject,
2475 // Label 64: @2739
2476 GIM_Try, /*On fail goto*//*Label 206*/ GIMT_Encode4(2750), // Rule ID 118 //
2477 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
2478 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_SMAX'
2479 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
2480 // Label 206: @2750
2481 GIM_Reject,
2482 // Label 65: @2751
2483 GIM_Try, /*On fail goto*//*Label 207*/ GIMT_Encode4(2762), // Rule ID 119 //
2484 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
2485 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_UMIN'
2486 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
2487 // Label 207: @2762
2488 GIM_Reject,
2489 // Label 66: @2763
2490 GIM_Try, /*On fail goto*//*Label 208*/ GIMT_Encode4(2774), // Rule ID 120 //
2491 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule64Enabled),
2492 // Combiner Rule #64: commute_int_constant_to_rhs; wip_match_opcode 'G_UMAX'
2493 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner52),
2494 // Label 208: @2774
2495 GIM_Reject,
2496 // Label 67: @2775
2497 GIM_Try, /*On fail goto*//*Label 209*/ GIMT_Encode4(2786), // Rule ID 96 //
2498 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule54Enabled),
2499 // Combiner Rule #54: unary_undef_to_zero; wip_match_opcode 'G_ABS'
2500 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner41),
2501 // Label 209: @2786
2502 GIM_Reject,
2503 // Label 68: @2787
2504 GIM_Try, /*On fail goto*//*Label 210*/ GIMT_Encode4(2798), // Rule ID 107 //
2505 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule60Enabled),
2506 // Combiner Rule #60: insert_extract_vec_elt_out_of_bounds; wip_match_opcode 'G_INSERT_VECTOR_ELT'
2507 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner48),
2508 // Label 210: @2798
2509 GIM_Reject,
2510 // Label 69: @2799
2511 GIM_Try, /*On fail goto*//*Label 211*/ GIMT_Encode4(2810), // Rule ID 16 //
2512 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule9Enabled),
2513 // Combiner Rule #9: extractvecelt_pairwise_add; wip_match_opcode 'G_EXTRACT_VECTOR_ELT'
2514 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner9),
2515 // Label 211: @2810
2516 GIM_Try, /*On fail goto*//*Label 212*/ GIMT_Encode4(2821), // Rule ID 108 //
2517 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule60Enabled),
2518 // Combiner Rule #60: insert_extract_vec_elt_out_of_bounds; wip_match_opcode 'G_EXTRACT_VECTOR_ELT'
2519 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner48),
2520 // Label 212: @2821
2521 GIM_Reject,
2522 // Label 70: @2822
2523 GIM_Try, /*On fail goto*//*Label 213*/ GIMT_Encode4(2833), // Rule ID 103 //
2524 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule56Enabled),
2525 // Combiner Rule #56: propagate_undef_all_ops; wip_match_opcode 'G_SHUFFLE_VECTOR'
2526 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner44),
2527 // Label 213: @2833
2528 GIM_Try, /*On fail goto*//*Label 214*/ GIMT_Encode4(2844), // Rule ID 104 //
2529 GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule57Enabled),
2530 // Combiner Rule #57: propagate_undef_shuffle_mask; wip_match_opcode 'G_SHUFFLE_VECTOR'
2531 GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner45),
2532 // Label 214: @2844
2533 GIM_Reject,
2534 // Label 71: @2845
2535 GIM_Reject,
2536 }; // Size: 2846 bytes
2537 return MatchTable0;
2538}
2539#undef GIMT_Encode2
2540#undef GIMT_Encode4
2541#undef GIMT_Encode8
2542
2543#endif // ifdef GET_GICOMBINER_IMPL
2544
2545#ifdef GET_GICOMBINER_CONSTRUCTOR_INITS
2546AvailableModuleFeatures(computeAvailableModuleFeatures(&STI)),
2547AvailableFunctionFeatures()
2548#endif // ifdef GET_GICOMBINER_CONSTRUCTOR_INITS
2549#ifdef GET_GICOMBINER_CONSTRUCTOR_INITS
2550, State(0),
2551ExecInfo(TypeObjects, NumTypeObjects, FeatureBitsets, ComplexPredicateFns, CustomRenderers)
2552#endif // ifdef GET_GICOMBINER_CONSTRUCTOR_INITS
2553
2554