Bump version to 19.1.0-rc3
[llvm-project.git] / llvm / test / TableGen / GlobalISelCombinerEmitter / match-table-permutations.td
blob4a908e78234844eedc3cac5311857c1e4e3a335a
1 // RUN: llvm-tblgen -I %p/../../../include -gen-global-isel-combiner \
2 // RUN:     -combiners=MyCombiner -gicombiner-debug-cxxpreds %s | \
3 // RUN: FileCheck %s
5 include "llvm/Target/Target.td"
6 include "llvm/Target/GlobalISel/Combine.td"
8 def MyTargetISA : InstrInfo;
9 def MyTarget : Target { let InstructionSet = MyTargetISA; }
11 def MatchFooPerms: GICombinePatFrag<
12     (outs root:$foo),
13     (ins gi_imm:$cst),
14     [
15       (pattern (G_ZEXT $foo, $b), (G_TRUNC $b, $x):$dbg0, "return foo(${x}, ${cst})"),
16       (pattern (G_TRUNC $foo, $z):$dbg1, "return bar(${foo}, ${cst})")
17     ]>;
19 def Test0 : GICombineRule<
20   (defs root:$dst),
21   (match (G_AND $dst, $cst0, $tmp),
22          (G_AND $tmp, $cst1, $cst2),
23          (MatchFooPerms $cst0, (i32 10)):$a,
24          (MatchFooPerms $cst1, (i32 20)):$b,
25          (MatchFooPerms $cst2, (i32 30)):$c
26   ),
27   (apply "APPLY ${cst0}")>;
29 def MyCombiner: GICombiner<"GenMyCombiner", [
30   Test0
31 ]>;
33 // CHECK:      bool GenMyCombiner::testMIPredicate_MI(unsigned PredicateID, const MachineInstr & MI, const MatcherState &State) const {
34 // CHECK-NEXT:   switch (PredicateID) {
35 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner0: {
36 // CHECK-NEXT:     // Pattern Alternatives: [a[0], b[0], c[0]]
37 // CHECK-NEXT:     return foo(State.MIs[2]->getOperand(1), 10)
38 // CHECK-NEXT:     llvm_unreachable("GICombiner0 should have returned");
39 // CHECK-NEXT:   }
40 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner1: {
41 // CHECK-NEXT:     // Pattern Alternatives: [a[0], b[0], c[0]]
42 // CHECK-NEXT:     return foo(State.MIs[5]->getOperand(1), 20)
43 // CHECK-NEXT:     llvm_unreachable("GICombiner1 should have returned");
44 // CHECK-NEXT:   }
45 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner2: {
46 // CHECK-NEXT:     // Pattern Alternatives: [a[0], b[0], c[0]]
47 // CHECK-NEXT:     return foo(State.MIs[7]->getOperand(1), 30)
48 // CHECK-NEXT:     llvm_unreachable("GICombiner2 should have returned");
49 // CHECK-NEXT:   }
50 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner3: {
51 // CHECK-NEXT:     // Pattern Alternatives: [a[0], b[0], c[1]]
52 // CHECK-NEXT:     return foo(State.MIs[2]->getOperand(1), 10)
53 // CHECK-NEXT:     llvm_unreachable("GICombiner3 should have returned");
54 // CHECK-NEXT:   }
55 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner4: {
56 // CHECK-NEXT:     // Pattern Alternatives: [a[0], b[0], c[1]]
57 // CHECK-NEXT:     return foo(State.MIs[5]->getOperand(1), 20)
58 // CHECK-NEXT:     llvm_unreachable("GICombiner4 should have returned");
59 // CHECK-NEXT:   }
60 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner5: {
61 // CHECK-NEXT:     // Pattern Alternatives: [a[0], b[0], c[1]]
62 // CHECK-NEXT:     return bar(State.MIs[3]->getOperand(2), 30)
63 // CHECK-NEXT:     llvm_unreachable("GICombiner5 should have returned");
64 // CHECK-NEXT:   }
65 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner6: {
66 // CHECK-NEXT:     // Pattern Alternatives: [a[0], b[1], c[0]]
67 // CHECK-NEXT:     return foo(State.MIs[2]->getOperand(1), 10)
68 // CHECK-NEXT:     llvm_unreachable("GICombiner6 should have returned");
69 // CHECK-NEXT:   }
70 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner7: {
71 // CHECK-NEXT:     // Pattern Alternatives: [a[0], b[1], c[0]]
72 // CHECK-NEXT:     return bar(State.MIs[3]->getOperand(1), 20)
73 // CHECK-NEXT:     llvm_unreachable("GICombiner7 should have returned");
74 // CHECK-NEXT:   }
75 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner8: {
76 // CHECK-NEXT:     // Pattern Alternatives: [a[0], b[1], c[0]]
77 // CHECK-NEXT:     return foo(State.MIs[6]->getOperand(1), 30)
78 // CHECK-NEXT:     llvm_unreachable("GICombiner8 should have returned");
79 // CHECK-NEXT:   }
80 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner9: {
81 // CHECK-NEXT:     // Pattern Alternatives: [a[0], b[1], c[1]]
82 // CHECK-NEXT:     return foo(State.MIs[2]->getOperand(1), 10)
83 // CHECK-NEXT:     llvm_unreachable("GICombiner9 should have returned");
84 // CHECK-NEXT:   }
85 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner10: {
86 // CHECK-NEXT:     // Pattern Alternatives: [a[0], b[1], c[1]]
87 // CHECK-NEXT:     return bar(State.MIs[3]->getOperand(1), 20)
88 // CHECK-NEXT:     llvm_unreachable("GICombiner10 should have returned");
89 // CHECK-NEXT:   }
90 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner11: {
91 // CHECK-NEXT:     // Pattern Alternatives: [a[0], b[1], c[1]]
92 // CHECK-NEXT:     return bar(State.MIs[3]->getOperand(2), 30)
93 // CHECK-NEXT:     llvm_unreachable("GICombiner11 should have returned");
94 // CHECK-NEXT:   }
95 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner12: {
96 // CHECK-NEXT:     // Pattern Alternatives: [a[1], b[0], c[0]]
97 // CHECK-NEXT:     return bar(State.MIs[0]->getOperand(1), 10)
98 // CHECK-NEXT:     llvm_unreachable("GICombiner12 should have returned");
99 // CHECK-NEXT:   }
100 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner13: {
101 // CHECK-NEXT:     // Pattern Alternatives: [a[1], b[0], c[0]]
102 // CHECK-NEXT:     return foo(State.MIs[4]->getOperand(1), 20)
103 // CHECK-NEXT:     llvm_unreachable("GICombiner13 should have returned");
104 // CHECK-NEXT:   }
105 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner14: {
106 // CHECK-NEXT:     // Pattern Alternatives: [a[1], b[0], c[0]]
107 // CHECK-NEXT:     return foo(State.MIs[6]->getOperand(1), 30)
108 // CHECK-NEXT:     llvm_unreachable("GICombiner14 should have returned");
109 // CHECK-NEXT:   }
110 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner15: {
111 // CHECK-NEXT:     // Pattern Alternatives: [a[1], b[0], c[1]]
112 // CHECK-NEXT:     return bar(State.MIs[0]->getOperand(1), 10)
113 // CHECK-NEXT:     llvm_unreachable("GICombiner15 should have returned");
114 // CHECK-NEXT:   }
115 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner16: {
116 // CHECK-NEXT:     // Pattern Alternatives: [a[1], b[0], c[1]]
117 // CHECK-NEXT:     return foo(State.MIs[4]->getOperand(1), 20)
118 // CHECK-NEXT:     llvm_unreachable("GICombiner16 should have returned");
119 // CHECK-NEXT:   }
120 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner17: {
121 // CHECK-NEXT:     // Pattern Alternatives: [a[1], b[0], c[1]]
122 // CHECK-NEXT:     return bar(State.MIs[3]->getOperand(2), 30)
123 // CHECK-NEXT:     llvm_unreachable("GICombiner17 should have returned");
124 // CHECK-NEXT:   }
125 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner18: {
126 // CHECK-NEXT:     // Pattern Alternatives: [a[1], b[1], c[0]]
127 // CHECK-NEXT:     return bar(State.MIs[0]->getOperand(1), 10)
128 // CHECK-NEXT:     llvm_unreachable("GICombiner18 should have returned");
129 // CHECK-NEXT:   }
130 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner19: {
131 // CHECK-NEXT:     // Pattern Alternatives: [a[1], b[1], c[0]]
132 // CHECK-NEXT:     return bar(State.MIs[3]->getOperand(1), 20)
133 // CHECK-NEXT:     llvm_unreachable("GICombiner19 should have returned");
134 // CHECK-NEXT:   }
135 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner20: {
136 // CHECK-NEXT:     // Pattern Alternatives: [a[1], b[1], c[0]]
137 // CHECK-NEXT:     return foo(State.MIs[5]->getOperand(1), 30)
138 // CHECK-NEXT:     llvm_unreachable("GICombiner20 should have returned");
139 // CHECK-NEXT:   }
140 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner21: {
141 // CHECK-NEXT:     // Pattern Alternatives: [a[1], b[1], c[1]]
142 // CHECK-NEXT:     return bar(State.MIs[0]->getOperand(1), 10)
143 // CHECK-NEXT:     llvm_unreachable("GICombiner21 should have returned");
144 // CHECK-NEXT:   }
145 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner22: {
146 // CHECK-NEXT:     // Pattern Alternatives: [a[1], b[1], c[1]]
147 // CHECK-NEXT:     return bar(State.MIs[3]->getOperand(1), 20)
148 // CHECK-NEXT:     llvm_unreachable("GICombiner22 should have returned");
149 // CHECK-NEXT:   }
150 // CHECK-NEXT:   case GICXXPred_MI_Predicate_GICombiner23: {
151 // CHECK-NEXT:     // Pattern Alternatives: [a[1], b[1], c[1]]
152 // CHECK-NEXT:     return bar(State.MIs[3]->getOperand(2), 30)
153 // CHECK-NEXT:     llvm_unreachable("GICombiner23 should have returned");
154 // CHECK-NEXT:   }
155 // CHECK-NEXT:   }
156 // CHECK-NEXT:   llvm_unreachable("Unknown predicate");
157 // CHECK-NEXT:   return false;
158 // CHECK-NEXT: }
160 // CHECK:      const uint8_t *GenMyCombiner::getMatchTable() const {
161 // CHECK-NEXT:   constexpr static uint8_t MatchTable0[] = {
162 // CHECK-NEXT:     GIM_Try, /*On fail goto*//*Label 0*/ GIMT_Encode4(562),
163 // CHECK-NEXT:       GIM_CheckOpcode, /*MI*/0, GIMT_Encode2(TargetOpcode::G_AND),
164 // CHECK-NEXT:       GIM_Try, /*On fail goto*//*Label 1*/ GIMT_Encode4(66), // Rule ID 7 //
165 // CHECK-NEXT:         GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule0Enabled),
166 // CHECK-NEXT:         // MIs[0] dst
167 // CHECK-NEXT:         // No operand predicates
168 // CHECK-NEXT:         // MIs[0] cst0
169 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
170 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_TRUNC),
171 // CHECK-NEXT:         // MIs[1] a.z
172 // CHECK-NEXT:         // No operand predicates
173 // CHECK-NEXT:         // MIs[0] tmp
174 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/2, /*MI*/0, /*OpIdx*/2, // MIs[2]
175 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/2, GIMT_Encode2(TargetOpcode::G_AND),
176 // CHECK-NEXT:         // MIs[2] cst1
177 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/3, /*MI*/2, /*OpIdx*/1, // MIs[3]
178 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/3, GIMT_Encode2(TargetOpcode::G_TRUNC),
179 // CHECK-NEXT:         // MIs[3] b.z
180 // CHECK-NEXT:         // No operand predicates
181 // CHECK-NEXT:         // MIs[2] cst2
182 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/4, /*MI*/2, /*OpIdx*/2, // MIs[4]
183 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/4, GIMT_Encode2(TargetOpcode::G_TRUNC),
184 // CHECK-NEXT:         // MIs[4] c.z
185 // CHECK-NEXT:         // No operand predicates
186 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner21),
187 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner22),
188 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner23),
189 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*NumInsns*/4,
190 // CHECK-NEXT:         // Combiner Rule #0: Test0 @ [a[1], b[1], c[1]]
191 // CHECK-NEXT:         GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner0),
192 // CHECK-NEXT:       // Label 1: @66
193 // CHECK-NEXT:       GIM_Try, /*On fail goto*//*Label 2*/ GIMT_Encode4(131), // Rule ID 6 //
194 // CHECK-NEXT:         GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule0Enabled),
195 // CHECK-NEXT:         // MIs[0] dst
196 // CHECK-NEXT:         // No operand predicates
197 // CHECK-NEXT:         // MIs[0] cst0
198 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
199 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_TRUNC),
200 // CHECK-NEXT:         // MIs[1] a.z
201 // CHECK-NEXT:         // No operand predicates
202 // CHECK-NEXT:         // MIs[0] tmp
203 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/2, /*MI*/0, /*OpIdx*/2, // MIs[2]
204 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/2, GIMT_Encode2(TargetOpcode::G_AND),
205 // CHECK-NEXT:         // MIs[2] cst1
206 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/3, /*MI*/2, /*OpIdx*/1, // MIs[3]
207 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/3, GIMT_Encode2(TargetOpcode::G_TRUNC),
208 // CHECK-NEXT:         // MIs[3] b.z
209 // CHECK-NEXT:         // No operand predicates
210 // CHECK-NEXT:         // MIs[2] cst2
211 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/4, /*MI*/2, /*OpIdx*/2, // MIs[4]
212 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/4, GIMT_Encode2(TargetOpcode::G_ZEXT),
213 // CHECK-NEXT:         // MIs[4] c.b
214 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/5, /*MI*/4, /*OpIdx*/1, // MIs[5]
215 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/5, GIMT_Encode2(TargetOpcode::G_TRUNC),
216 // CHECK-NEXT:         // MIs[5] c.x
217 // CHECK-NEXT:         // No operand predicates
218 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner18),
219 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner19),
220 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner20),
221 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*NumInsns*/5,
222 // CHECK-NEXT:         // Combiner Rule #0: Test0 @ [a[1], b[1], c[0]]
223 // CHECK-NEXT:         GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner0),
224 // CHECK-NEXT:       // Label 2: @131
225 // CHECK-NEXT:       GIM_Try, /*On fail goto*//*Label 3*/ GIMT_Encode4(196), // Rule ID 5 //
226 // CHECK-NEXT:         GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule0Enabled),
227 // CHECK-NEXT:         // MIs[0] dst
228 // CHECK-NEXT:         // No operand predicates
229 // CHECK-NEXT:         // MIs[0] cst0
230 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
231 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_TRUNC),
232 // CHECK-NEXT:         // MIs[1] a.z
233 // CHECK-NEXT:         // No operand predicates
234 // CHECK-NEXT:         // MIs[0] tmp
235 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/2, /*MI*/0, /*OpIdx*/2, // MIs[2]
236 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/2, GIMT_Encode2(TargetOpcode::G_AND),
237 // CHECK-NEXT:         // MIs[2] cst1
238 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/3, /*MI*/2, /*OpIdx*/1, // MIs[3]
239 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/3, GIMT_Encode2(TargetOpcode::G_ZEXT),
240 // CHECK-NEXT:         // MIs[3] b.b
241 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/4, /*MI*/3, /*OpIdx*/1, // MIs[4]
242 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/4, GIMT_Encode2(TargetOpcode::G_TRUNC),
243 // CHECK-NEXT:         // MIs[4] b.x
244 // CHECK-NEXT:         // No operand predicates
245 // CHECK-NEXT:         // MIs[2] cst2
246 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/5, /*MI*/2, /*OpIdx*/2, // MIs[5]
247 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/5, GIMT_Encode2(TargetOpcode::G_TRUNC),
248 // CHECK-NEXT:         // MIs[5] c.z
249 // CHECK-NEXT:         // No operand predicates
250 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner15),
251 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner16),
252 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner17),
253 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*NumInsns*/5,
254 // CHECK-NEXT:         // Combiner Rule #0: Test0 @ [a[1], b[0], c[1]]
255 // CHECK-NEXT:         GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner0),
256 // CHECK-NEXT:       // Label 3: @196
257 // CHECK-NEXT:       GIM_Try, /*On fail goto*//*Label 4*/ GIMT_Encode4(269), // Rule ID 4 //
258 // CHECK-NEXT:         GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule0Enabled),
259 // CHECK-NEXT:         // MIs[0] dst
260 // CHECK-NEXT:         // No operand predicates
261 // CHECK-NEXT:         // MIs[0] cst0
262 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
263 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_TRUNC),
264 // CHECK-NEXT:         // MIs[1] a.z
265 // CHECK-NEXT:         // No operand predicates
266 // CHECK-NEXT:         // MIs[0] tmp
267 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/2, /*MI*/0, /*OpIdx*/2, // MIs[2]
268 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/2, GIMT_Encode2(TargetOpcode::G_AND),
269 // CHECK-NEXT:         // MIs[2] cst1
270 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/3, /*MI*/2, /*OpIdx*/1, // MIs[3]
271 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/3, GIMT_Encode2(TargetOpcode::G_ZEXT),
272 // CHECK-NEXT:         // MIs[3] b.b
273 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/4, /*MI*/3, /*OpIdx*/1, // MIs[4]
274 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/4, GIMT_Encode2(TargetOpcode::G_TRUNC),
275 // CHECK-NEXT:         // MIs[4] b.x
276 // CHECK-NEXT:         // No operand predicates
277 // CHECK-NEXT:         // MIs[2] cst2
278 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/5, /*MI*/2, /*OpIdx*/2, // MIs[5]
279 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/5, GIMT_Encode2(TargetOpcode::G_ZEXT),
280 // CHECK-NEXT:         // MIs[5] c.b
281 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/6, /*MI*/5, /*OpIdx*/1, // MIs[6]
282 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/6, GIMT_Encode2(TargetOpcode::G_TRUNC),
283 // CHECK-NEXT:         // MIs[6] c.x
284 // CHECK-NEXT:         // No operand predicates
285 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner12),
286 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner13),
287 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner14),
288 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*NumInsns*/6,
289 // CHECK-NEXT:         // Combiner Rule #0: Test0 @ [a[1], b[0], c[0]]
290 // CHECK-NEXT:         GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner0),
291 // CHECK-NEXT:       // Label 4: @269
292 // CHECK-NEXT:       GIM_Try, /*On fail goto*//*Label 5*/ GIMT_Encode4(334), // Rule ID 3 //
293 // CHECK-NEXT:         GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule0Enabled),
294 // CHECK-NEXT:         // MIs[0] dst
295 // CHECK-NEXT:         // No operand predicates
296 // CHECK-NEXT:         // MIs[0] cst0
297 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
298 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_ZEXT),
299 // CHECK-NEXT:         // MIs[1] a.b
300 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/2, /*MI*/1, /*OpIdx*/1, // MIs[2]
301 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/2, GIMT_Encode2(TargetOpcode::G_TRUNC),
302 // CHECK-NEXT:         // MIs[2] a.x
303 // CHECK-NEXT:         // No operand predicates
304 // CHECK-NEXT:         // MIs[0] tmp
305 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/3, /*MI*/0, /*OpIdx*/2, // MIs[3]
306 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/3, GIMT_Encode2(TargetOpcode::G_AND),
307 // CHECK-NEXT:         // MIs[3] cst1
308 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/4, /*MI*/3, /*OpIdx*/1, // MIs[4]
309 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/4, GIMT_Encode2(TargetOpcode::G_TRUNC),
310 // CHECK-NEXT:         // MIs[4] b.z
311 // CHECK-NEXT:         // No operand predicates
312 // CHECK-NEXT:         // MIs[3] cst2
313 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/5, /*MI*/3, /*OpIdx*/2, // MIs[5]
314 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/5, GIMT_Encode2(TargetOpcode::G_TRUNC),
315 // CHECK-NEXT:         // MIs[5] c.z
316 // CHECK-NEXT:         // No operand predicates
317 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner9),
318 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner10),
319 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner11),
320 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*NumInsns*/5,
321 // CHECK-NEXT:         // Combiner Rule #0: Test0 @ [a[0], b[1], c[1]]
322 // CHECK-NEXT:         GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner0),
323 // CHECK-NEXT:       // Label 5: @334
324 // CHECK-NEXT:       GIM_Try, /*On fail goto*//*Label 6*/ GIMT_Encode4(407), // Rule ID 2 //
325 // CHECK-NEXT:         GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule0Enabled),
326 // CHECK-NEXT:         // MIs[0] dst
327 // CHECK-NEXT:         // No operand predicates
328 // CHECK-NEXT:         // MIs[0] cst0
329 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
330 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_ZEXT),
331 // CHECK-NEXT:         // MIs[1] a.b
332 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/2, /*MI*/1, /*OpIdx*/1, // MIs[2]
333 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/2, GIMT_Encode2(TargetOpcode::G_TRUNC),
334 // CHECK-NEXT:         // MIs[2] a.x
335 // CHECK-NEXT:         // No operand predicates
336 // CHECK-NEXT:         // MIs[0] tmp
337 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/3, /*MI*/0, /*OpIdx*/2, // MIs[3]
338 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/3, GIMT_Encode2(TargetOpcode::G_AND),
339 // CHECK-NEXT:         // MIs[3] cst1
340 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/4, /*MI*/3, /*OpIdx*/1, // MIs[4]
341 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/4, GIMT_Encode2(TargetOpcode::G_TRUNC),
342 // CHECK-NEXT:         // MIs[4] b.z
343 // CHECK-NEXT:         // No operand predicates
344 // CHECK-NEXT:         // MIs[3] cst2
345 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/5, /*MI*/3, /*OpIdx*/2, // MIs[5]
346 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/5, GIMT_Encode2(TargetOpcode::G_ZEXT),
347 // CHECK-NEXT:         // MIs[5] c.b
348 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/6, /*MI*/5, /*OpIdx*/1, // MIs[6]
349 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/6, GIMT_Encode2(TargetOpcode::G_TRUNC),
350 // CHECK-NEXT:         // MIs[6] c.x
351 // CHECK-NEXT:         // No operand predicates
352 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner6),
353 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner7),
354 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner8),
355 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*NumInsns*/6,
356 // CHECK-NEXT:         // Combiner Rule #0: Test0 @ [a[0], b[1], c[0]]
357 // CHECK-NEXT:         GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner0),
358 // CHECK-NEXT:       // Label 6: @407
359 // CHECK-NEXT:       GIM_Try, /*On fail goto*//*Label 7*/ GIMT_Encode4(480), // Rule ID 1 //
360 // CHECK-NEXT:         GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule0Enabled),
361 // CHECK-NEXT:         // MIs[0] dst
362 // CHECK-NEXT:         // No operand predicates
363 // CHECK-NEXT:         // MIs[0] cst0
364 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
365 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_ZEXT),
366 // CHECK-NEXT:         // MIs[1] a.b
367 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/2, /*MI*/1, /*OpIdx*/1, // MIs[2]
368 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/2, GIMT_Encode2(TargetOpcode::G_TRUNC),
369 // CHECK-NEXT:         // MIs[2] a.x
370 // CHECK-NEXT:         // No operand predicates
371 // CHECK-NEXT:         // MIs[0] tmp
372 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/3, /*MI*/0, /*OpIdx*/2, // MIs[3]
373 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/3, GIMT_Encode2(TargetOpcode::G_AND),
374 // CHECK-NEXT:         // MIs[3] cst1
375 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/4, /*MI*/3, /*OpIdx*/1, // MIs[4]
376 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/4, GIMT_Encode2(TargetOpcode::G_ZEXT),
377 // CHECK-NEXT:         // MIs[4] b.b
378 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/5, /*MI*/4, /*OpIdx*/1, // MIs[5]
379 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/5, GIMT_Encode2(TargetOpcode::G_TRUNC),
380 // CHECK-NEXT:         // MIs[5] b.x
381 // CHECK-NEXT:         // No operand predicates
382 // CHECK-NEXT:         // MIs[3] cst2
383 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/6, /*MI*/3, /*OpIdx*/2, // MIs[6]
384 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/6, GIMT_Encode2(TargetOpcode::G_TRUNC),
385 // CHECK-NEXT:         // MIs[6] c.z
386 // CHECK-NEXT:         // No operand predicates
387 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner3),
388 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner4),
389 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner5),
390 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*NumInsns*/6,
391 // CHECK-NEXT:         // Combiner Rule #0: Test0 @ [a[0], b[0], c[1]]
392 // CHECK-NEXT:         GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner0),
393 // CHECK-NEXT:       // Label 7: @480
394 // CHECK-NEXT:       GIM_Try, /*On fail goto*//*Label 8*/ GIMT_Encode4(561), // Rule ID 0 //
395 // CHECK-NEXT:         GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule0Enabled),
396 // CHECK-NEXT:         // MIs[0] dst
397 // CHECK-NEXT:         // No operand predicates
398 // CHECK-NEXT:         // MIs[0] cst0
399 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
400 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_ZEXT),
401 // CHECK-NEXT:         // MIs[1] a.b
402 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/2, /*MI*/1, /*OpIdx*/1, // MIs[2]
403 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/2, GIMT_Encode2(TargetOpcode::G_TRUNC),
404 // CHECK-NEXT:         // MIs[2] a.x
405 // CHECK-NEXT:         // No operand predicates
406 // CHECK-NEXT:         // MIs[0] tmp
407 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/3, /*MI*/0, /*OpIdx*/2, // MIs[3]
408 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/3, GIMT_Encode2(TargetOpcode::G_AND),
409 // CHECK-NEXT:         // MIs[3] cst1
410 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/4, /*MI*/3, /*OpIdx*/1, // MIs[4]
411 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/4, GIMT_Encode2(TargetOpcode::G_ZEXT),
412 // CHECK-NEXT:         // MIs[4] b.b
413 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/5, /*MI*/4, /*OpIdx*/1, // MIs[5]
414 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/5, GIMT_Encode2(TargetOpcode::G_TRUNC),
415 // CHECK-NEXT:         // MIs[5] b.x
416 // CHECK-NEXT:         // No operand predicates
417 // CHECK-NEXT:         // MIs[3] cst2
418 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/6, /*MI*/3, /*OpIdx*/2, // MIs[6]
419 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/6, GIMT_Encode2(TargetOpcode::G_ZEXT),
420 // CHECK-NEXT:         // MIs[6] c.b
421 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/7, /*MI*/6, /*OpIdx*/1, // MIs[7]
422 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/7, GIMT_Encode2(TargetOpcode::G_TRUNC),
423 // CHECK-NEXT:         // MIs[7] c.x
424 // CHECK-NEXT:         // No operand predicates
425 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner0),
426 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner1),
427 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_GICombiner2),
428 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*NumInsns*/7,
429 // CHECK-NEXT:         // Combiner Rule #0: Test0 @ [a[0], b[0], c[0]]
430 // CHECK-NEXT:         GIR_DoneWithCustomAction, /*Fn*/GIMT_Encode2(GICXXCustomAction_GICombiner0),
431 // CHECK-NEXT:       // Label 8: @561
432 // CHECK-NEXT:       GIM_Reject,
433 // CHECK-NEXT:     // Label 0: @562
434 // CHECK-NEXT:     GIM_Reject,
435 // CHECK-NEXT:     }; // Size: 563 bytes
436 // CHECK-NEXT:   return MatchTable0;
437 // CHECK-NEXT: }