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