Coverage Report

Created: 2024-01-17 10:31

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