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