1/*===- TableGen'erated file -------------------------------------*- C++ -*-===*\
2|* *|
3|* RISCVO0PreLegalizerCombinerImpl Combiner Match Table *|
4|* *|
5|* Automatically generated file, do not edit! *|
6|* *|
7\*===----------------------------------------------------------------------===*/
8
9#ifdef GET_GICOMBINER_DEPS
10
11#include "llvm/ADT/SparseBitVector.h"
12namespace llvm {
13
14extern cl::OptionCategory GICombinerOptionCategory;
15
16} // namespace llvm
17
18#endif // GET_GICOMBINER_DEPS
19
20#ifdef GET_GICOMBINER_TYPES
21
22struct RISCVO0PreLegalizerCombinerImplRuleConfig {
23 SparseBitVector<> DisabledRules;
24
25 bool isRuleEnabled(unsigned RuleID) const;
26 bool parseCommandLineOption();
27 bool setRuleEnabled(StringRef RuleIdentifier);
28 bool setRuleDisabled(StringRef RuleIdentifier);
29};
30
31static std::optional<uint64_t> getRuleIdxForIdentifier(StringRef RuleIdentifier) {
32 uint64_t I;
33 // getAtInteger(...) returns false on success
34 bool Parsed = !RuleIdentifier.getAsInteger(0, I);
35 if (Parsed)
36 return I;
37
38#ifndef NDEBUG
39 switch (RuleIdentifier.size()) {
40 default: break;
41 case 9: // 1 string to match.
42 if (memcmp(RuleIdentifier.data()+0, "copy_prop", 9) != 0)
43 break;
44 return 0; // "copy_prop"
45 case 10: // 2 strings to match.
46 switch (RuleIdentifier[0]) {
47 default: break;
48 case 'm': // 1 string to match.
49 if (memcmp(RuleIdentifier.data()+1, "ul_to_shl", 9) != 0)
50 break;
51 return 1; // "mul_to_shl"
52 case 's': // 1 string to match.
53 if (memcmp(RuleIdentifier.data()+1, "ub_to_add", 9) != 0)
54 break;
55 return 2; // "sub_to_add"
56 }
57 break;
58 case 12: // 1 string to match.
59 if (memcmp(RuleIdentifier.data()+0, "not_cmp_fold", 12) != 0)
60 break;
61 return 9; // "not_cmp_fold"
62 case 13: // 1 string to match.
63 if (memcmp(RuleIdentifier.data()+0, "load_and_mask", 13) != 0)
64 break;
65 return 8; // "load_and_mask"
66 case 14: // 1 string to match.
67 if (memcmp(RuleIdentifier.data()+0, "mul_by_neg_one", 14) != 0)
68 break;
69 return 4; // "mul_by_neg_one"
70 case 15: // 2 strings to match.
71 switch (RuleIdentifier[0]) {
72 default: break;
73 case 'e': // 1 string to match.
74 if (memcmp(RuleIdentifier.data()+1, "xtending_loads", 14) != 0)
75 break;
76 return 7; // "extending_loads"
77 case 'i': // 1 string to match.
78 if (memcmp(RuleIdentifier.data()+1, "dempotent_prop", 14) != 0)
79 break;
80 return 5; // "idempotent_prop"
81 }
82 break;
83 case 17: // 1 string to match.
84 if (memcmp(RuleIdentifier.data()+0, "add_p2i_to_ptradd", 17) != 0)
85 break;
86 return 3; // "add_p2i_to_ptradd"
87 case 19: // 1 string to match.
88 if (memcmp(RuleIdentifier.data()+0, "ptr_add_immed_chain", 19) != 0)
89 break;
90 return 6; // "ptr_add_immed_chain"
91 case 21: // 1 string to match.
92 if (memcmp(RuleIdentifier.data()+0, "combine_concat_vector", 21) != 0)
93 break;
94 return 10; // "combine_concat_vector"
95 }
96#endif // ifndef NDEBUG
97
98 return std::nullopt;
99}
100static std::optional<std::pair<uint64_t, uint64_t>> getRuleRangeForIdentifier(StringRef RuleIdentifier) {
101 std::pair<StringRef, StringRef> RangePair = RuleIdentifier.split('-');
102 if (!RangePair.second.empty()) {
103 const auto First = getRuleIdxForIdentifier(RangePair.first);
104 const auto Last = getRuleIdxForIdentifier(RangePair.second);
105 if (!First || !Last)
106 return std::nullopt;
107 if (First >= Last)
108 report_fatal_error("Beginning of range should be before end of range");
109 return {{*First, *Last + 1}};
110 }
111 if (RangePair.first == "*") {
112 return {{0, 11}};
113 }
114 const auto I = getRuleIdxForIdentifier(RangePair.first);
115 if (!I)
116 return std::nullopt;
117 return {{*I, *I + 1}};
118}
119
120bool RISCVO0PreLegalizerCombinerImplRuleConfig::setRuleEnabled(StringRef RuleIdentifier) {
121 auto MaybeRange = getRuleRangeForIdentifier(RuleIdentifier);
122 if (!MaybeRange)
123 return false;
124 for (auto I = MaybeRange->first; I < MaybeRange->second; ++I)
125 DisabledRules.reset(I);
126 return true;
127}
128
129bool RISCVO0PreLegalizerCombinerImplRuleConfig::setRuleDisabled(StringRef RuleIdentifier) {
130 auto MaybeRange = getRuleRangeForIdentifier(RuleIdentifier);
131 if (!MaybeRange)
132 return false;
133 for (auto I = MaybeRange->first; I < MaybeRange->second; ++I)
134 DisabledRules.set(I);
135 return true;
136}
137
138static std::vector<std::string> RISCVO0PreLegalizerCombinerOption;
139static cl::list<std::string> RISCVO0PreLegalizerCombinerDisableOption(
140 "riscvo0prelegalizercombiner-disable-rule",
141 cl::desc("Disable one or more combiner rules temporarily in the RISCVO0PreLegalizerCombiner pass"),
142 cl::CommaSeparated,
143 cl::Hidden,
144 cl::cat(GICombinerOptionCategory),
145 cl::callback([](const std::string &Str) {
146 RISCVO0PreLegalizerCombinerOption.push_back(Str);
147 }));
148static cl::list<std::string> RISCVO0PreLegalizerCombinerOnlyEnableOption(
149 "riscvo0prelegalizercombiner-only-enable-rule",
150 cl::desc("Disable all rules in the RISCVO0PreLegalizerCombiner pass then re-enable the specified ones"),
151 cl::Hidden,
152 cl::cat(GICombinerOptionCategory),
153 cl::callback([](const std::string &CommaSeparatedArg) {
154 StringRef Str = CommaSeparatedArg;
155 RISCVO0PreLegalizerCombinerOption.push_back("*");
156 do {
157 auto X = Str.split(",");
158 RISCVO0PreLegalizerCombinerOption.push_back(("!" + X.first).str());
159 Str = X.second;
160 } while (!Str.empty());
161 }));
162
163
164bool RISCVO0PreLegalizerCombinerImplRuleConfig::isRuleEnabled(unsigned RuleID) const {
165 return !DisabledRules.test(RuleID);
166}
167bool RISCVO0PreLegalizerCombinerImplRuleConfig::parseCommandLineOption() {
168 for (StringRef Identifier : RISCVO0PreLegalizerCombinerOption) {
169 bool Enabled = Identifier.consume_front("!");
170 if (Enabled && !setRuleEnabled(Identifier))
171 return false;
172 if (!Enabled && !setRuleDisabled(Identifier))
173 return false;
174 }
175 return true;
176}
177
178
179#endif // GET_GICOMBINER_TYPES
180
181#ifdef GET_GICOMBINER_TYPES
182
183const unsigned MAX_SUBTARGET_PREDICATES = 0;
184using PredicateBitset = llvm::Bitset<MAX_SUBTARGET_PREDICATES>;
185
186#endif // GET_GICOMBINER_TYPES
187
188#ifdef GET_GICOMBINER_CLASS_MEMBERS
189
190 bool canMatchOpcode(unsigned Opc) const override;
191
192#endif // GET_GICOMBINER_CLASS_MEMBERS
193
194#ifdef GET_GICOMBINER_CLASS_MEMBERS
195
196PredicateBitset AvailableModuleFeatures;
197mutable PredicateBitset AvailableFunctionFeatures;
198PredicateBitset getAvailableFeatures() const {
199 return AvailableModuleFeatures | AvailableFunctionFeatures;
200}
201PredicateBitset
202computeAvailableModuleFeatures(const RISCVSubtarget *Subtarget) const;
203PredicateBitset
204computeAvailableFunctionFeatures(const RISCVSubtarget *Subtarget,
205 const MachineFunction *MF) const;
206void setupGeneratedPerFunctionState(MachineFunction &MF) override;
207
208#endif // GET_GICOMBINER_CLASS_MEMBERS
209
210#ifdef GET_GICOMBINER_CLASS_MEMBERS
211
212 mutable MatcherState State;
213 typedef ComplexRendererFns(RISCVO0PreLegalizerCombinerImpl::*ComplexMatcherMemFn)(MachineOperand &) const;
214 typedef void(RISCVO0PreLegalizerCombinerImpl::*CustomRendererFn)(MachineInstrBuilder &, const MachineInstr &, int) const;
215 const ExecInfoTy<PredicateBitset, ComplexMatcherMemFn, CustomRendererFn> ExecInfo;
216 static RISCVO0PreLegalizerCombinerImpl::ComplexMatcherMemFn ComplexPredicateFns[];
217 static RISCVO0PreLegalizerCombinerImpl::CustomRendererFn CustomRenderers[];
218 bool testImmPredicate_I64(unsigned PredicateID, int64_t Imm) const override;
219 bool testImmPredicate_APInt(unsigned PredicateID, const APInt &Imm) const override;
220 bool testImmPredicate_APFloat(unsigned PredicateID, const APFloat &Imm) const override;
221 const uint8_t *getMatchTable() const override;
222 bool testMIPredicate_MI(unsigned PredicateID, const MachineInstr &MI, const MatcherState &State) const override;
223 bool testMOPredicate_MO(unsigned PredicateID, const MachineOperand &MO, const MatcherState &State) const override;
224 bool testSimplePredicate(unsigned PredicateID) const override;
225 bool runCustomAction(unsigned FnID, const MatcherState &State, NewMIVector &OutMIs) const override;
226
227#endif // GET_GICOMBINER_CLASS_MEMBERS
228
229#ifdef GET_GICOMBINER_IMPL
230
231// LLT Objects.
232enum {
233 GILLT_s1,
234};
235const static size_t NumTypeObjects = 1;
236const static LLT TypeObjects[] = {
237 LLT::scalar(1),
238};
239
240// Bits for subtarget features that participate in instruction matching.
241enum SubtargetFeatureBits : uint8_t {
242};
243
244PredicateBitset RISCVO0PreLegalizerCombinerImpl::
245computeAvailableModuleFeatures(const RISCVSubtarget *Subtarget) const {
246 PredicateBitset Features{};
247 return Features;
248}
249
250void RISCVO0PreLegalizerCombinerImpl::setupGeneratedPerFunctionState(MachineFunction &MF) {
251 AvailableFunctionFeatures = computeAvailableFunctionFeatures((const RISCVSubtarget *)&MF.getSubtarget(), &MF);
252}
253PredicateBitset RISCVO0PreLegalizerCombinerImpl::
254computeAvailableFunctionFeatures(const RISCVSubtarget *Subtarget, const MachineFunction *MF) const {
255 PredicateBitset Features{};
256 return Features;
257}
258
259// Feature bitsets.
260enum {
261 GIFBS_Invalid,
262};
263constexpr static PredicateBitset FeatureBitsets[] {
264 {}, // GIFBS_Invalid
265};
266
267// ComplexPattern predicates.
268enum {
269 GICP_Invalid,
270};
271// See constructor for table contents
272
273RISCVO0PreLegalizerCombinerImpl::ComplexMatcherMemFn
274RISCVO0PreLegalizerCombinerImpl::ComplexPredicateFns[] = {
275 nullptr, // GICP_Invalid
276};
277
278bool RISCVO0PreLegalizerCombinerImpl::testMIPredicate_MI(unsigned PredicateID, const MachineInstr & MI, const MatcherState &State) const {
279 llvm_unreachable("Unknown predicate");
280 return false;
281}
282bool RISCVO0PreLegalizerCombinerImpl::testMOPredicate_MO(unsigned PredicateID, const MachineOperand & MO, const MatcherState &State) const {
283 llvm_unreachable("Unknown predicate");
284 return false;
285}
286bool RISCVO0PreLegalizerCombinerImpl::testImmPredicate_I64(unsigned PredicateID, int64_t Imm) const {
287 llvm_unreachable("Unknown predicate");
288 return false;
289}
290bool RISCVO0PreLegalizerCombinerImpl::testImmPredicate_APFloat(unsigned PredicateID, const APFloat & Imm) const {
291 llvm_unreachable("Unknown predicate");
292 return false;
293}
294bool RISCVO0PreLegalizerCombinerImpl::testImmPredicate_APInt(unsigned PredicateID, const APInt & Imm) const {
295 llvm_unreachable("Unknown predicate");
296 return false;
297}
298enum {
299 GICXXPred_Simple_IsRule0Enabled = GICXXPred_Invalid + 1,
300 GICXXPred_Simple_IsRule1Enabled,
301 GICXXPred_Simple_IsRule2Enabled,
302 GICXXPred_Simple_IsRule3Enabled,
303 GICXXPred_Simple_IsRule4Enabled,
304 GICXXPred_Simple_IsRule5Enabled,
305 GICXXPred_Simple_IsRule6Enabled,
306 GICXXPred_Simple_IsRule7Enabled,
307 GICXXPred_Simple_IsRule8Enabled,
308 GICXXPred_Simple_IsRule9Enabled,
309 GICXXPred_Simple_IsRule10Enabled,
310};
311
312bool RISCVO0PreLegalizerCombinerImpl::testSimplePredicate(unsigned Predicate) const {
313 return RuleConfig.isRuleEnabled(Predicate - GICXXPred_Invalid - 1);
314}
315// Custom renderers.
316enum {
317 GICR_Invalid,
318};
319RISCVO0PreLegalizerCombinerImpl::CustomRendererFn
320RISCVO0PreLegalizerCombinerImpl::CustomRenderers[] = {
321 nullptr, // GICR_Invalid
322};
323
324bool RISCVO0PreLegalizerCombinerImpl::canMatchOpcode(unsigned Opc) const {
325 switch (Opc) {
326 case TargetOpcode::G_MUL:
327 case TargetOpcode::G_SUB:
328 case TargetOpcode::COPY:
329 case TargetOpcode::G_FABS:
330 case TargetOpcode::G_FCANONICALIZE:
331 case TargetOpcode::G_FREEZE:
332 case TargetOpcode::G_ADD:
333 case TargetOpcode::G_AND:
334 case TargetOpcode::G_CONCAT_VECTORS:
335 case TargetOpcode::G_LOAD:
336 case TargetOpcode::G_PTR_ADD:
337 case TargetOpcode::G_SEXTLOAD:
338 case TargetOpcode::G_XOR:
339 case TargetOpcode::G_ZEXTLOAD:
340 return true;
341 default:
342 return false;
343 }
344}
345
346bool RISCVO0PreLegalizerCombinerImpl::tryCombineAll(MachineInstr &I) const {
347 const PredicateBitset AvailableFeatures = getAvailableFeatures();
348 State.MIs.clear();
349 State.MIs.push_back(&I);
350 if (executeMatchTable(*this, State, ExecInfo, B, getMatchTable(), Helper.getTII(), MRI, Helper.getTRI(), Helper.getRBI(), AvailableFeatures, /*CoverageInfo*/ nullptr)) {
351 return true;
352 }
353
354 return false;
355}
356
357enum {
358 GICXXCustomAction_GICombiner0 = GICXXCustomAction_Invalid + 1,
359 GICXXCustomAction_GICombiner1,
360 GICXXCustomAction_GICombiner2,
361 GICXXCustomAction_GICombiner3,
362 GICXXCustomAction_GICombiner4,
363 GICXXCustomAction_GICombiner5,
364 GICXXCustomAction_GICombiner6,
365 GICXXCustomAction_GICombiner7,
366 GICXXCustomAction_GICombiner8,
367};
368bool RISCVO0PreLegalizerCombinerImpl::runCustomAction(unsigned ApplyID, const MatcherState &State, NewMIVector &OutMIs) const {
369 Helper.getBuilder().setInstrAndDebugLoc(*State.MIs[0]);
370 switch(ApplyID) {
371 case GICXXCustomAction_GICombiner0:{
372 // Match Patterns
373 if(![&](){return Helper.matchCombineCopy(*State.MIs[0]);}()) {
374 return false;
375 }
376 // Apply Patterns
377 Helper.applyCombineCopy(*State.MIs[0]);
378 return true;
379 }
380 case GICXXCustomAction_GICombiner1:{
381 unsigned GIMatchData_matchinfo;
382 // Match Patterns
383 if(![&](){return Helper.matchCombineMulToShl(*State.MIs[0], GIMatchData_matchinfo);}()) {
384 return false;
385 }
386 // Apply Patterns
387 Helper.applyCombineMulToShl(*State.MIs[0], GIMatchData_matchinfo);
388 return true;
389 }
390 case GICXXCustomAction_GICombiner2:{
391 std::function<void(MachineIRBuilder &)> GIMatchData_matchinfo;
392 // Match Patterns
393 if(![&](){return Helper.matchCombineSubToAdd(*State.MIs[0], GIMatchData_matchinfo);}()) {
394 return false;
395 }
396 // Apply Patterns
397 Helper.applyBuildFnNoErase(*State.MIs[0], GIMatchData_matchinfo);
398 return true;
399 }
400 case GICXXCustomAction_GICombiner3:{
401 std::pair<Register, bool> GIMatchData_info;
402 // Match Patterns
403 if(![&](){return Helper.matchCombineAddP2IToPtrAdd(*State.MIs[0], GIMatchData_info);}()) {
404 return false;
405 }
406 // Apply Patterns
407 Helper.applyCombineAddP2IToPtrAdd(*State.MIs[0], GIMatchData_info);
408 return true;
409 }
410 case GICXXCustomAction_GICombiner4:{
411 PtrAddChain GIMatchData_matchinfo;
412 // Match Patterns
413 if(![&](){return Helper.matchPtrAddImmedChain(*State.MIs[0], GIMatchData_matchinfo);}()) {
414 return false;
415 }
416 // Apply Patterns
417 Helper.applyPtrAddImmedChain(*State.MIs[0], GIMatchData_matchinfo);
418 return true;
419 }
420 case GICXXCustomAction_GICombiner5:{
421 PreferredTuple GIMatchData_matchinfo;
422 // Match Patterns
423 if(![&](){return Helper.matchCombineExtendingLoads(*State.MIs[0], GIMatchData_matchinfo);}()) {
424 return false;
425 }
426 // Apply Patterns
427 Helper.applyCombineExtendingLoads(*State.MIs[0], GIMatchData_matchinfo);
428 return true;
429 }
430 case GICXXCustomAction_GICombiner6:{
431 std::function<void(MachineIRBuilder &)> GIMatchData_matchinfo;
432 // Match Patterns
433 if(![&](){return Helper.matchCombineLoadWithAndMask(*State.MIs[0], GIMatchData_matchinfo);}()) {
434 return false;
435 }
436 // Apply Patterns
437 Helper.applyBuildFn(*State.MIs[0], GIMatchData_matchinfo);
438 return true;
439 }
440 case GICXXCustomAction_GICombiner7:{
441 SmallVector<Register> GIMatchData_info;
442 // Match Patterns
443 if(![&](){return Helper.matchNotCmp(*State.MIs[0], GIMatchData_info);}()) {
444 return false;
445 }
446 // Apply Patterns
447 Helper.applyNotCmp(*State.MIs[0], GIMatchData_info);
448 return true;
449 }
450 case GICXXCustomAction_GICombiner8:{
451 SmallVector<Register> GIMatchData_matchinfo;
452 // Match Patterns
453 if(![&](){return Helper.matchCombineConcatVectors(*State.MIs[0], GIMatchData_matchinfo);}()) {
454 return false;
455 }
456 // Apply Patterns
457 Helper.applyCombineConcatVectors(*State.MIs[0], GIMatchData_matchinfo);
458 return true;
459 }
460 }
461 llvm_unreachable("Unknown Apply Action");
462}
463#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
464#define GIMT_Encode2(Val) uint8_t(Val), uint8_t((Val) >> 8)
465#define GIMT_Encode4(Val) uint8_t(Val), uint8_t((Val) >> 8), uint8_t((Val) >> 16), uint8_t((Val) >> 24)
466#define GIMT_Encode8(Val) uint8_t(Val), uint8_t((Val) >> 8), uint8_t((Val) >> 16), uint8_t((Val) >> 24), uint8_t(uint64_t(Val) >> 32), uint8_t(uint64_t(Val) >> 40), uint8_t(uint64_t(Val) >> 48), uint8_t(uint64_t(Val) >> 56)
467#else
468#define GIMT_Encode2(Val) uint8_t((Val) >> 8), uint8_t(Val)
469#define GIMT_Encode4(Val) uint8_t((Val) >> 24), uint8_t((Val) >> 16), uint8_t((Val) >> 8), uint8_t(Val)
470#define GIMT_Encode8(Val) uint8_t(uint64_t(Val) >> 56), uint8_t(uint64_t(Val) >> 48), uint8_t(uint64_t(Val) >> 40), uint8_t(uint64_t(Val) >> 32), uint8_t((Val) >> 24), uint8_t((Val) >> 16), uint8_t((Val) >> 8), uint8_t(Val)
471#endif
472const uint8_t *RISCVO0PreLegalizerCombinerImpl::getMatchTable() const {
473 constexpr static uint8_t MatchTable0[] = {
474 /* 0 */ GIM_SwitchOpcode, /*MI*/0, /*[*/GIMT_Encode2(20), GIMT_Encode2(241), /*)*//*default:*//*Label 14*/ GIMT_Encode4(1166),
475 /* 10 */ /*TargetOpcode::COPY*//*Label 0*/ GIMT_Encode4(894), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
476 /* 150 */ /*TargetOpcode::G_ADD*//*Label 1*/ GIMT_Encode4(906),
477 /* 154 */ /*TargetOpcode::G_SUB*//*Label 2*/ GIMT_Encode4(918),
478 /* 158 */ /*TargetOpcode::G_MUL*//*Label 3*/ GIMT_Encode4(940), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
479 /* 186 */ /*TargetOpcode::G_AND*//*Label 4*/ GIMT_Encode4(992), GIMT_Encode4(0),
480 /* 194 */ /*TargetOpcode::G_XOR*//*Label 5*/ GIMT_Encode4(1004), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
481 /* 270 */ /*TargetOpcode::G_CONCAT_VECTORS*//*Label 6*/ GIMT_Encode4(1016), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
482 /* 286 */ /*TargetOpcode::G_FREEZE*//*Label 7*/ GIMT_Encode4(1028), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
483 /* 326 */ /*TargetOpcode::G_LOAD*//*Label 8*/ GIMT_Encode4(1058),
484 /* 330 */ /*TargetOpcode::G_SEXTLOAD*//*Label 9*/ GIMT_Encode4(1070),
485 /* 334 */ /*TargetOpcode::G_ZEXTLOAD*//*Label 10*/ GIMT_Encode4(1082), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
486 /* 810 */ /*TargetOpcode::G_FABS*//*Label 11*/ GIMT_Encode4(1094), GIMT_Encode4(0), GIMT_Encode4(0),
487 /* 822 */ /*TargetOpcode::G_FCANONICALIZE*//*Label 12*/ GIMT_Encode4(1124), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0), GIMT_Encode4(0),
488 /* 890 */ /*TargetOpcode::G_PTR_ADD*//*Label 13*/ GIMT_Encode4(1154),
489 /* 894 */ // Label 0: @894
490 /* 894 */ GIM_Try, /*On fail goto*//*Label 15*/ GIMT_Encode4(905), // Rule ID 0 //
491 /* 899 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule0Enabled),
492 /* 902 */ // MIs[0] d
493 /* 902 */ // No operand predicates
494 /* 902 */ // MIs[0] s
495 /* 902 */ // No operand predicates
496 /* 902 */ // Combiner Rule #0: copy_prop
497 /* 902 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner0),
498 /* 905 */ // Label 15: @905
499 /* 905 */ GIM_Reject,
500 /* 906 */ // Label 1: @906
501 /* 906 */ GIM_Try, /*On fail goto*//*Label 16*/ GIMT_Encode4(917), // Rule ID 3 //
502 /* 911 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule3Enabled),
503 /* 914 */ // Combiner Rule #3: add_p2i_to_ptradd; wip_match_opcode 'G_ADD'
504 /* 914 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner3),
505 /* 917 */ // Label 16: @917
506 /* 917 */ GIM_Reject,
507 /* 918 */ // Label 2: @918
508 /* 918 */ GIM_Try, /*On fail goto*//*Label 17*/ GIMT_Encode4(939), // Rule ID 2 //
509 /* 923 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule2Enabled),
510 /* 926 */ // MIs[0] d
511 /* 926 */ // No operand predicates
512 /* 926 */ // MIs[0] op1
513 /* 926 */ // No operand predicates
514 /* 926 */ // MIs[0] c
515 /* 926 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1]
516 /* 930 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_CONSTANT),
517 /* 934 */ // MIs[1] imm
518 /* 934 */ // No operand predicates
519 /* 934 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
520 /* 936 */ // Combiner Rule #2: sub_to_add
521 /* 936 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner2),
522 /* 939 */ // Label 17: @939
523 /* 939 */ GIM_Reject,
524 /* 940 */ // Label 3: @940
525 /* 940 */ GIM_Try, /*On fail goto*//*Label 18*/ GIMT_Encode4(980), // Rule ID 4 //
526 /* 945 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule4Enabled),
527 /* 948 */ // MIs[0] dst
528 /* 948 */ GIM_RecordRegType, /*MI*/0, /*Op*/0, /*TempTypeIdx*/255,
529 /* 952 */ // MIs[0] x
530 /* 952 */ // No operand predicates
531 /* 952 */ // MIs[0] Operand 2
532 /* 952 */ GIM_CheckConstantInt8, /*MI*/0, /*Op*/2, 255,
533 /* 956 */ GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/255,
534 /* 959 */ GIR_BuildConstant, /*TempRegID*/0, /*Val*/GIMT_Encode8(0),
535 /* 969 */ // Combiner Rule #4: mul_by_neg_one
536 /* 969 */ GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(TargetOpcode::G_SUB),
537 /* 972 */ GIR_RootToRootCopy, /*OpIdx*/0, // dst
538 /* 974 */ GIR_AddSimpleTempRegister, /*InsnID*/0, /*TempRegID*/0,
539 /* 977 */ GIR_RootToRootCopy, /*OpIdx*/1, // x
540 /* 979 */ GIR_EraseRootFromParent_Done,
541 /* 980 */ // Label 18: @980
542 /* 980 */ GIM_Try, /*On fail goto*//*Label 19*/ GIMT_Encode4(991), // Rule ID 1 //
543 /* 985 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule1Enabled),
544 /* 988 */ // MIs[0] d
545 /* 988 */ // No operand predicates
546 /* 988 */ // MIs[0] op1
547 /* 988 */ // No operand predicates
548 /* 988 */ // MIs[0] op2
549 /* 988 */ // No operand predicates
550 /* 988 */ // Combiner Rule #1: mul_to_shl
551 /* 988 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner1),
552 /* 991 */ // Label 19: @991
553 /* 991 */ GIM_Reject,
554 /* 992 */ // Label 4: @992
555 /* 992 */ GIM_Try, /*On fail goto*//*Label 20*/ GIMT_Encode4(1003), // Rule ID 12 //
556 /* 997 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule8Enabled),
557 /* 1000 */ // Combiner Rule #8: load_and_mask; wip_match_opcode 'G_AND'
558 /* 1000 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner6),
559 /* 1003 */ // Label 20: @1003
560 /* 1003 */ GIM_Reject,
561 /* 1004 */ // Label 5: @1004
562 /* 1004 */ GIM_Try, /*On fail goto*//*Label 21*/ GIMT_Encode4(1015), // Rule ID 13 //
563 /* 1009 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule9Enabled),
564 /* 1012 */ // Combiner Rule #9: not_cmp_fold; wip_match_opcode 'G_XOR'
565 /* 1012 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner7),
566 /* 1015 */ // Label 21: @1015
567 /* 1015 */ GIM_Reject,
568 /* 1016 */ // Label 6: @1016
569 /* 1016 */ GIM_Try, /*On fail goto*//*Label 22*/ GIMT_Encode4(1027), // Rule ID 14 //
570 /* 1021 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule10Enabled),
571 /* 1024 */ // Combiner Rule #10: combine_concat_vector; wip_match_opcode 'G_CONCAT_VECTORS'
572 /* 1024 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner8),
573 /* 1027 */ // Label 22: @1027
574 /* 1027 */ GIM_Reject,
575 /* 1028 */ // Label 7: @1028
576 /* 1028 */ GIM_Try, /*On fail goto*//*Label 23*/ GIMT_Encode4(1057), // Rule ID 5 //
577 /* 1033 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule5Enabled),
578 /* 1036 */ // MIs[0] dst
579 /* 1036 */ // No operand predicates
580 /* 1036 */ // MIs[0] src
581 /* 1036 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
582 /* 1040 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_FREEZE),
583 /* 1044 */ // MIs[1] __idempotent_prop_match_0.x
584 /* 1044 */ // No operand predicates
585 /* 1044 */ GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
586 /* 1049 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
587 /* 1051 */ // Combiner Rule #5: idempotent_prop @ [__idempotent_prop_match_0[0]]
588 /* 1051 */ GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
589 /* 1056 */ GIR_EraseRootFromParent_Done,
590 /* 1057 */ // Label 23: @1057
591 /* 1057 */ GIM_Reject,
592 /* 1058 */ // Label 8: @1058
593 /* 1058 */ GIM_Try, /*On fail goto*//*Label 24*/ GIMT_Encode4(1069), // Rule ID 9 //
594 /* 1063 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule7Enabled),
595 /* 1066 */ // Combiner Rule #7: extending_loads; wip_match_opcode 'G_LOAD'
596 /* 1066 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner5),
597 /* 1069 */ // Label 24: @1069
598 /* 1069 */ GIM_Reject,
599 /* 1070 */ // Label 9: @1070
600 /* 1070 */ GIM_Try, /*On fail goto*//*Label 25*/ GIMT_Encode4(1081), // Rule ID 10 //
601 /* 1075 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule7Enabled),
602 /* 1078 */ // Combiner Rule #7: extending_loads; wip_match_opcode 'G_SEXTLOAD'
603 /* 1078 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner5),
604 /* 1081 */ // Label 25: @1081
605 /* 1081 */ GIM_Reject,
606 /* 1082 */ // Label 10: @1082
607 /* 1082 */ GIM_Try, /*On fail goto*//*Label 26*/ GIMT_Encode4(1093), // Rule ID 11 //
608 /* 1087 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule7Enabled),
609 /* 1090 */ // Combiner Rule #7: extending_loads; wip_match_opcode 'G_ZEXTLOAD'
610 /* 1090 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner5),
611 /* 1093 */ // Label 26: @1093
612 /* 1093 */ GIM_Reject,
613 /* 1094 */ // Label 11: @1094
614 /* 1094 */ GIM_Try, /*On fail goto*//*Label 27*/ GIMT_Encode4(1123), // Rule ID 6 //
615 /* 1099 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule5Enabled),
616 /* 1102 */ // MIs[0] dst
617 /* 1102 */ // No operand predicates
618 /* 1102 */ // MIs[0] src
619 /* 1102 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
620 /* 1106 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_FABS),
621 /* 1110 */ // MIs[1] __idempotent_prop_match_0.x
622 /* 1110 */ // No operand predicates
623 /* 1110 */ GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
624 /* 1115 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
625 /* 1117 */ // Combiner Rule #5: idempotent_prop @ [__idempotent_prop_match_0[1]]
626 /* 1117 */ GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
627 /* 1122 */ GIR_EraseRootFromParent_Done,
628 /* 1123 */ // Label 27: @1123
629 /* 1123 */ GIM_Reject,
630 /* 1124 */ // Label 12: @1124
631 /* 1124 */ GIM_Try, /*On fail goto*//*Label 28*/ GIMT_Encode4(1153), // Rule ID 7 //
632 /* 1129 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule5Enabled),
633 /* 1132 */ // MIs[0] dst
634 /* 1132 */ // No operand predicates
635 /* 1132 */ // MIs[0] src
636 /* 1132 */ GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
637 /* 1136 */ GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_FCANONICALIZE),
638 /* 1140 */ // MIs[1] __idempotent_prop_match_0.x
639 /* 1140 */ // No operand predicates
640 /* 1140 */ GIM_CheckCanReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
641 /* 1145 */ GIM_CheckIsSafeToFold, /*NumInsns*/1,
642 /* 1147 */ // Combiner Rule #5: idempotent_prop @ [__idempotent_prop_match_0[2]]
643 /* 1147 */ GIR_ReplaceReg, /*OldInsnID*/0, /*OldOpIdx*/0, /*NewInsnId*/0, /*NewOpIdx*/1,
644 /* 1152 */ GIR_EraseRootFromParent_Done,
645 /* 1153 */ // Label 28: @1153
646 /* 1153 */ GIM_Reject,
647 /* 1154 */ // Label 13: @1154
648 /* 1154 */ GIM_Try, /*On fail goto*//*Label 29*/ GIMT_Encode4(1165), // Rule ID 8 //
649 /* 1159 */ GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule6Enabled),
650 /* 1162 */ // Combiner Rule #6: ptr_add_immed_chain; wip_match_opcode 'G_PTR_ADD'
651 /* 1162 */ GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner4),
652 /* 1165 */ // Label 29: @1165
653 /* 1165 */ GIM_Reject,
654 /* 1166 */ // Label 14: @1166
655 /* 1166 */ GIM_Reject,
656 /* 1167 */ }; // Size: 1167 bytes
657 return MatchTable0;
658}
659#undef GIMT_Encode2
660#undef GIMT_Encode4
661#undef GIMT_Encode8
662
663
664#endif // GET_GICOMBINER_IMPL
665
666#ifdef GET_GICOMBINER_CONSTRUCTOR_INITS
667
668AvailableModuleFeatures(computeAvailableModuleFeatures(&STI)),
669AvailableFunctionFeatures()
670
671#endif // GET_GICOMBINER_CONSTRUCTOR_INITS
672
673#ifdef GET_GICOMBINER_CONSTRUCTOR_INITS
674
675, State(0),
676ExecInfo(TypeObjects, NumTypeObjects, FeatureBitsets, ComplexPredicateFns, CustomRenderers)
677
678#endif // GET_GICOMBINER_CONSTRUCTOR_INITS
679
680