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