[NFC][RemoveDIs] Prefer iterators over inst-pointers in InstCombine
[llvm-project.git] / llvm / test / TableGen / GlobalISelCombinerEmitter / match-table-permutations.td
blobe6825ba6607ea6a499a922a415824e45929929ba
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 (COPY $dst, (i32 0)), "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 int64_t *GenMyCombiner::getMatchTable() const {
161 // CHECK-NEXT:   constexpr static int64_t MatchTable0[] = {
162 // CHECK-NEXT:     GIM_Try, /*On fail goto*//*Label 0*/ 746,
163 // CHECK-NEXT:       GIM_CheckOpcode, /*MI*/0, TargetOpcode::G_AND,
164 // CHECK-NEXT:       GIM_Try, /*On fail goto*//*Label 1*/ 111, // Rule ID 0 //
165 // CHECK-NEXT:         GIM_CheckSimplePredicate, 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, TargetOpcode::G_ZEXT,
171 // CHECK-NEXT:         // MIs[1] a.b
172 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/2, /*MI*/1, /*OpIdx*/1, // MIs[2]
173 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/2, TargetOpcode::G_TRUNC,
174 // CHECK-NEXT:         // MIs[2] a.x
175 // CHECK-NEXT:         // No operand predicates
176 // CHECK-NEXT:         // MIs[0] tmp
177 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/3, /*MI*/0, /*OpIdx*/2, // MIs[3]
178 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/3, TargetOpcode::G_AND,
179 // CHECK-NEXT:         // MIs[3] cst1
180 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/4, /*MI*/3, /*OpIdx*/1, // MIs[4]
181 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/4, TargetOpcode::G_ZEXT,
182 // CHECK-NEXT:         // MIs[4] b.b
183 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/5, /*MI*/4, /*OpIdx*/1, // MIs[5]
184 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/5, TargetOpcode::G_TRUNC,
185 // CHECK-NEXT:         // MIs[5] b.x
186 // CHECK-NEXT:         // No operand predicates
187 // CHECK-NEXT:         // MIs[3] cst2
188 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/6, /*MI*/3, /*OpIdx*/2, // MIs[6]
189 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/6, TargetOpcode::G_ZEXT,
190 // CHECK-NEXT:         // MIs[6] c.b
191 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/7, /*MI*/6, /*OpIdx*/1, // MIs[7]
192 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/7, TargetOpcode::G_TRUNC,
193 // CHECK-NEXT:         // MIs[7] c.x
194 // CHECK-NEXT:         // No operand predicates
195 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner0,
196 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner1,
197 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner2,
198 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/1,
199 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/2,
200 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/3,
201 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/4,
202 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/5,
203 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/6,
204 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/7,
205 // CHECK-NEXT:         GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
206 // CHECK-NEXT:         GIR_BuildMI, /*InsnID*/1, /*Opcode*/TargetOpcode::G_CONSTANT,
207 // CHECK-NEXT:         GIR_AddTempRegister, /*InsnID*/1, /*TempRegID*/0, /*TempRegFlags*/0,
208 // CHECK-NEXT:         GIR_AddCImm, /*InsnID*/1, /*Type*/GILLT_s32, /*Imm*/0,
209 // CHECK-NEXT:         // Combiner Rule #0: Test0 @ [a[0], b[0], c[0]]
210 // CHECK-NEXT:         GIR_BuildMI, /*InsnID*/0, /*Opcode*/TargetOpcode::COPY,
211 // CHECK-NEXT:         GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/0, /*OpIdx*/0, // dst
212 // CHECK-NEXT:         GIR_AddTempRegister, /*InsnID*/0, /*TempRegID*/0, /*TempRegFlags*/0,
213 // CHECK-NEXT:         GIR_EraseFromParent, /*InsnID*/0,
214 // CHECK-NEXT:         GIR_CustomAction, GICXXCustomAction_CombineApplyGICombiner0,
215 // CHECK-NEXT:         GIR_Done,
216 // CHECK-NEXT:       // Label 1: @111
217 // CHECK-NEXT:       GIM_Try, /*On fail goto*//*Label 2*/ 208, // Rule ID 1 //
218 // CHECK-NEXT:         GIM_CheckSimplePredicate, GICXXPred_Simple_IsRule0Enabled,
219 // CHECK-NEXT:         // MIs[0] dst
220 // CHECK-NEXT:         // No operand predicates
221 // CHECK-NEXT:         // MIs[0] cst0
222 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
223 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/1, TargetOpcode::G_ZEXT,
224 // CHECK-NEXT:         // MIs[1] a.b
225 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/2, /*MI*/1, /*OpIdx*/1, // MIs[2]
226 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/2, TargetOpcode::G_TRUNC,
227 // CHECK-NEXT:         // MIs[2] a.x
228 // CHECK-NEXT:         // No operand predicates
229 // CHECK-NEXT:         // MIs[0] tmp
230 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/3, /*MI*/0, /*OpIdx*/2, // MIs[3]
231 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/3, TargetOpcode::G_AND,
232 // CHECK-NEXT:         // MIs[3] cst1
233 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/4, /*MI*/3, /*OpIdx*/1, // MIs[4]
234 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/4, TargetOpcode::G_ZEXT,
235 // CHECK-NEXT:         // MIs[4] b.b
236 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/5, /*MI*/4, /*OpIdx*/1, // MIs[5]
237 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/5, TargetOpcode::G_TRUNC,
238 // CHECK-NEXT:         // MIs[5] b.x
239 // CHECK-NEXT:         // No operand predicates
240 // CHECK-NEXT:         // MIs[3] cst2
241 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/6, /*MI*/3, /*OpIdx*/2, // MIs[6]
242 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/6, TargetOpcode::G_TRUNC,
243 // CHECK-NEXT:         // MIs[6] c.z
244 // CHECK-NEXT:         // No operand predicates
245 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner3,
246 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner4,
247 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner5,
248 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/1,
249 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/2,
250 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/3,
251 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/4,
252 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/5,
253 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/6,
254 // CHECK-NEXT:         GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
255 // CHECK-NEXT:         GIR_BuildMI, /*InsnID*/1, /*Opcode*/TargetOpcode::G_CONSTANT,
256 // CHECK-NEXT:         GIR_AddTempRegister, /*InsnID*/1, /*TempRegID*/0, /*TempRegFlags*/0,
257 // CHECK-NEXT:         GIR_AddCImm, /*InsnID*/1, /*Type*/GILLT_s32, /*Imm*/0,
258 // CHECK-NEXT:         // Combiner Rule #0: Test0 @ [a[0], b[0], c[1]]
259 // CHECK-NEXT:         GIR_BuildMI, /*InsnID*/0, /*Opcode*/TargetOpcode::COPY,
260 // CHECK-NEXT:         GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/0, /*OpIdx*/0, // dst
261 // CHECK-NEXT:         GIR_AddTempRegister, /*InsnID*/0, /*TempRegID*/0, /*TempRegFlags*/0,
262 // CHECK-NEXT:         GIR_EraseFromParent, /*InsnID*/0,
263 // CHECK-NEXT:         GIR_CustomAction, GICXXCustomAction_CombineApplyGICombiner0,
264 // CHECK-NEXT:         GIR_Done,
265 // CHECK-NEXT:       // Label 2: @208
266 // CHECK-NEXT:       GIM_Try, /*On fail goto*//*Label 3*/ 305, // Rule ID 2 //
267 // CHECK-NEXT:         GIM_CheckSimplePredicate, GICXXPred_Simple_IsRule0Enabled,
268 // CHECK-NEXT:         // MIs[0] dst
269 // CHECK-NEXT:         // No operand predicates
270 // CHECK-NEXT:         // MIs[0] cst0
271 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
272 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/1, TargetOpcode::G_ZEXT,
273 // CHECK-NEXT:         // MIs[1] a.b
274 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/2, /*MI*/1, /*OpIdx*/1, // MIs[2]
275 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/2, TargetOpcode::G_TRUNC,
276 // CHECK-NEXT:         // MIs[2] a.x
277 // CHECK-NEXT:         // No operand predicates
278 // CHECK-NEXT:         // MIs[0] tmp
279 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/3, /*MI*/0, /*OpIdx*/2, // MIs[3]
280 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/3, TargetOpcode::G_AND,
281 // CHECK-NEXT:         // MIs[3] cst1
282 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/4, /*MI*/3, /*OpIdx*/1, // MIs[4]
283 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/4, TargetOpcode::G_TRUNC,
284 // CHECK-NEXT:         // MIs[4] b.z
285 // CHECK-NEXT:         // No operand predicates
286 // CHECK-NEXT:         // MIs[3] cst2
287 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/5, /*MI*/3, /*OpIdx*/2, // MIs[5]
288 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/5, TargetOpcode::G_ZEXT,
289 // CHECK-NEXT:         // MIs[5] c.b
290 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/6, /*MI*/5, /*OpIdx*/1, // MIs[6]
291 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/6, TargetOpcode::G_TRUNC,
292 // CHECK-NEXT:         // MIs[6] c.x
293 // CHECK-NEXT:         // No operand predicates
294 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner6,
295 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner7,
296 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner8,
297 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/1,
298 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/2,
299 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/3,
300 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/4,
301 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/5,
302 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/6,
303 // CHECK-NEXT:         GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
304 // CHECK-NEXT:         GIR_BuildMI, /*InsnID*/1, /*Opcode*/TargetOpcode::G_CONSTANT,
305 // CHECK-NEXT:         GIR_AddTempRegister, /*InsnID*/1, /*TempRegID*/0, /*TempRegFlags*/0,
306 // CHECK-NEXT:         GIR_AddCImm, /*InsnID*/1, /*Type*/GILLT_s32, /*Imm*/0,
307 // CHECK-NEXT:         // Combiner Rule #0: Test0 @ [a[0], b[1], c[0]]
308 // CHECK-NEXT:         GIR_BuildMI, /*InsnID*/0, /*Opcode*/TargetOpcode::COPY,
309 // CHECK-NEXT:         GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/0, /*OpIdx*/0, // dst
310 // CHECK-NEXT:         GIR_AddTempRegister, /*InsnID*/0, /*TempRegID*/0, /*TempRegFlags*/0,
311 // CHECK-NEXT:         GIR_EraseFromParent, /*InsnID*/0,
312 // CHECK-NEXT:         GIR_CustomAction, GICXXCustomAction_CombineApplyGICombiner0,
313 // CHECK-NEXT:         GIR_Done,
314 // CHECK-NEXT:       // Label 3: @305
315 // CHECK-NEXT:       GIM_Try, /*On fail goto*//*Label 4*/ 393, // Rule ID 3 //
316 // CHECK-NEXT:         GIM_CheckSimplePredicate, GICXXPred_Simple_IsRule0Enabled,
317 // CHECK-NEXT:         // MIs[0] dst
318 // CHECK-NEXT:         // No operand predicates
319 // CHECK-NEXT:         // MIs[0] cst0
320 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
321 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/1, TargetOpcode::G_ZEXT,
322 // CHECK-NEXT:         // MIs[1] a.b
323 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/2, /*MI*/1, /*OpIdx*/1, // MIs[2]
324 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/2, TargetOpcode::G_TRUNC,
325 // CHECK-NEXT:         // MIs[2] a.x
326 // CHECK-NEXT:         // No operand predicates
327 // CHECK-NEXT:         // MIs[0] tmp
328 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/3, /*MI*/0, /*OpIdx*/2, // MIs[3]
329 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/3, TargetOpcode::G_AND,
330 // CHECK-NEXT:         // MIs[3] cst1
331 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/4, /*MI*/3, /*OpIdx*/1, // MIs[4]
332 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/4, TargetOpcode::G_TRUNC,
333 // CHECK-NEXT:         // MIs[4] b.z
334 // CHECK-NEXT:         // No operand predicates
335 // CHECK-NEXT:         // MIs[3] cst2
336 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/5, /*MI*/3, /*OpIdx*/2, // MIs[5]
337 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/5, TargetOpcode::G_TRUNC,
338 // CHECK-NEXT:         // MIs[5] c.z
339 // CHECK-NEXT:         // No operand predicates
340 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner9,
341 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner10,
342 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner11,
343 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/1,
344 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/2,
345 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/3,
346 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/4,
347 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/5,
348 // CHECK-NEXT:         GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
349 // CHECK-NEXT:         GIR_BuildMI, /*InsnID*/1, /*Opcode*/TargetOpcode::G_CONSTANT,
350 // CHECK-NEXT:         GIR_AddTempRegister, /*InsnID*/1, /*TempRegID*/0, /*TempRegFlags*/0,
351 // CHECK-NEXT:         GIR_AddCImm, /*InsnID*/1, /*Type*/GILLT_s32, /*Imm*/0,
352 // CHECK-NEXT:         // Combiner Rule #0: Test0 @ [a[0], b[1], c[1]]
353 // CHECK-NEXT:         GIR_BuildMI, /*InsnID*/0, /*Opcode*/TargetOpcode::COPY,
354 // CHECK-NEXT:         GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/0, /*OpIdx*/0, // dst
355 // CHECK-NEXT:         GIR_AddTempRegister, /*InsnID*/0, /*TempRegID*/0, /*TempRegFlags*/0,
356 // CHECK-NEXT:         GIR_EraseFromParent, /*InsnID*/0,
357 // CHECK-NEXT:         GIR_CustomAction, GICXXCustomAction_CombineApplyGICombiner0,
358 // CHECK-NEXT:         GIR_Done,
359 // CHECK-NEXT:       // Label 4: @393
360 // CHECK-NEXT:       GIM_Try, /*On fail goto*//*Label 5*/ 490, // Rule ID 4 //
361 // CHECK-NEXT:         GIM_CheckSimplePredicate, GICXXPred_Simple_IsRule0Enabled,
362 // CHECK-NEXT:         // MIs[0] dst
363 // CHECK-NEXT:         // No operand predicates
364 // CHECK-NEXT:         // MIs[0] cst0
365 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
366 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/1, TargetOpcode::G_TRUNC,
367 // CHECK-NEXT:         // MIs[1] a.z
368 // CHECK-NEXT:         // No operand predicates
369 // CHECK-NEXT:         // MIs[0] tmp
370 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/2, /*MI*/0, /*OpIdx*/2, // MIs[2]
371 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/2, TargetOpcode::G_AND,
372 // CHECK-NEXT:         // MIs[2] cst1
373 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/3, /*MI*/2, /*OpIdx*/1, // MIs[3]
374 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/3, TargetOpcode::G_ZEXT,
375 // CHECK-NEXT:         // MIs[3] b.b
376 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/4, /*MI*/3, /*OpIdx*/1, // MIs[4]
377 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/4, TargetOpcode::G_TRUNC,
378 // CHECK-NEXT:         // MIs[4] b.x
379 // CHECK-NEXT:         // No operand predicates
380 // CHECK-NEXT:         // MIs[2] cst2
381 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/5, /*MI*/2, /*OpIdx*/2, // MIs[5]
382 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/5, TargetOpcode::G_ZEXT,
383 // CHECK-NEXT:         // MIs[5] c.b
384 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/6, /*MI*/5, /*OpIdx*/1, // MIs[6]
385 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/6, TargetOpcode::G_TRUNC,
386 // CHECK-NEXT:         // MIs[6] c.x
387 // CHECK-NEXT:         // No operand predicates
388 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner12,
389 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner13,
390 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner14,
391 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/1,
392 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/2,
393 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/3,
394 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/4,
395 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/5,
396 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/6,
397 // CHECK-NEXT:         GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
398 // CHECK-NEXT:         GIR_BuildMI, /*InsnID*/1, /*Opcode*/TargetOpcode::G_CONSTANT,
399 // CHECK-NEXT:         GIR_AddTempRegister, /*InsnID*/1, /*TempRegID*/0, /*TempRegFlags*/0,
400 // CHECK-NEXT:         GIR_AddCImm, /*InsnID*/1, /*Type*/GILLT_s32, /*Imm*/0,
401 // CHECK-NEXT:         // Combiner Rule #0: Test0 @ [a[1], b[0], c[0]]
402 // CHECK-NEXT:         GIR_BuildMI, /*InsnID*/0, /*Opcode*/TargetOpcode::COPY,
403 // CHECK-NEXT:         GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/0, /*OpIdx*/0, // dst
404 // CHECK-NEXT:         GIR_AddTempRegister, /*InsnID*/0, /*TempRegID*/0, /*TempRegFlags*/0,
405 // CHECK-NEXT:         GIR_EraseFromParent, /*InsnID*/0,
406 // CHECK-NEXT:         GIR_CustomAction, GICXXCustomAction_CombineApplyGICombiner0,
407 // CHECK-NEXT:         GIR_Done,
408 // CHECK-NEXT:       // Label 5: @490
409 // CHECK-NEXT:       GIM_Try, /*On fail goto*//*Label 6*/ 578, // Rule ID 5 //
410 // CHECK-NEXT:         GIM_CheckSimplePredicate, GICXXPred_Simple_IsRule0Enabled,
411 // CHECK-NEXT:         // MIs[0] dst
412 // CHECK-NEXT:         // No operand predicates
413 // CHECK-NEXT:         // MIs[0] cst0
414 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
415 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/1, TargetOpcode::G_TRUNC,
416 // CHECK-NEXT:         // MIs[1] a.z
417 // CHECK-NEXT:         // No operand predicates
418 // CHECK-NEXT:         // MIs[0] tmp
419 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/2, /*MI*/0, /*OpIdx*/2, // MIs[2]
420 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/2, TargetOpcode::G_AND,
421 // CHECK-NEXT:         // MIs[2] cst1
422 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/3, /*MI*/2, /*OpIdx*/1, // MIs[3]
423 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/3, TargetOpcode::G_ZEXT,
424 // CHECK-NEXT:         // MIs[3] b.b
425 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/4, /*MI*/3, /*OpIdx*/1, // MIs[4]
426 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/4, TargetOpcode::G_TRUNC,
427 // CHECK-NEXT:         // MIs[4] b.x
428 // CHECK-NEXT:         // No operand predicates
429 // CHECK-NEXT:         // MIs[2] cst2
430 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/5, /*MI*/2, /*OpIdx*/2, // MIs[5]
431 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/5, TargetOpcode::G_TRUNC,
432 // CHECK-NEXT:         // MIs[5] c.z
433 // CHECK-NEXT:         // No operand predicates
434 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner15,
435 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner16,
436 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner17,
437 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/1,
438 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/2,
439 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/3,
440 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/4,
441 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/5,
442 // CHECK-NEXT:         GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
443 // CHECK-NEXT:         GIR_BuildMI, /*InsnID*/1, /*Opcode*/TargetOpcode::G_CONSTANT,
444 // CHECK-NEXT:         GIR_AddTempRegister, /*InsnID*/1, /*TempRegID*/0, /*TempRegFlags*/0,
445 // CHECK-NEXT:         GIR_AddCImm, /*InsnID*/1, /*Type*/GILLT_s32, /*Imm*/0,
446 // CHECK-NEXT:         // Combiner Rule #0: Test0 @ [a[1], b[0], c[1]]
447 // CHECK-NEXT:         GIR_BuildMI, /*InsnID*/0, /*Opcode*/TargetOpcode::COPY,
448 // CHECK-NEXT:         GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/0, /*OpIdx*/0, // dst
449 // CHECK-NEXT:         GIR_AddTempRegister, /*InsnID*/0, /*TempRegID*/0, /*TempRegFlags*/0,
450 // CHECK-NEXT:         GIR_EraseFromParent, /*InsnID*/0,
451 // CHECK-NEXT:         GIR_CustomAction, GICXXCustomAction_CombineApplyGICombiner0,
452 // CHECK-NEXT:         GIR_Done,
453 // CHECK-NEXT:       // Label 6: @578
454 // CHECK-NEXT:       GIM_Try, /*On fail goto*//*Label 7*/ 666, // Rule ID 6 //
455 // CHECK-NEXT:         GIM_CheckSimplePredicate, GICXXPred_Simple_IsRule0Enabled,
456 // CHECK-NEXT:         // MIs[0] dst
457 // CHECK-NEXT:         // No operand predicates
458 // CHECK-NEXT:         // MIs[0] cst0
459 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
460 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/1, TargetOpcode::G_TRUNC,
461 // CHECK-NEXT:         // MIs[1] a.z
462 // CHECK-NEXT:         // No operand predicates
463 // CHECK-NEXT:         // MIs[0] tmp
464 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/2, /*MI*/0, /*OpIdx*/2, // MIs[2]
465 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/2, TargetOpcode::G_AND,
466 // CHECK-NEXT:         // MIs[2] cst1
467 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/3, /*MI*/2, /*OpIdx*/1, // MIs[3]
468 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/3, TargetOpcode::G_TRUNC,
469 // CHECK-NEXT:         // MIs[3] b.z
470 // CHECK-NEXT:         // No operand predicates
471 // CHECK-NEXT:         // MIs[2] cst2
472 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/4, /*MI*/2, /*OpIdx*/2, // MIs[4]
473 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/4, TargetOpcode::G_ZEXT,
474 // CHECK-NEXT:         // MIs[4] c.b
475 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/5, /*MI*/4, /*OpIdx*/1, // MIs[5]
476 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/5, TargetOpcode::G_TRUNC,
477 // CHECK-NEXT:         // MIs[5] c.x
478 // CHECK-NEXT:         // No operand predicates
479 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner18,
480 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner19,
481 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner20,
482 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/1,
483 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/2,
484 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/3,
485 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/4,
486 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/5,
487 // CHECK-NEXT:         GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
488 // CHECK-NEXT:         GIR_BuildMI, /*InsnID*/1, /*Opcode*/TargetOpcode::G_CONSTANT,
489 // CHECK-NEXT:         GIR_AddTempRegister, /*InsnID*/1, /*TempRegID*/0, /*TempRegFlags*/0,
490 // CHECK-NEXT:         GIR_AddCImm, /*InsnID*/1, /*Type*/GILLT_s32, /*Imm*/0,
491 // CHECK-NEXT:         // Combiner Rule #0: Test0 @ [a[1], b[1], c[0]]
492 // CHECK-NEXT:         GIR_BuildMI, /*InsnID*/0, /*Opcode*/TargetOpcode::COPY,
493 // CHECK-NEXT:         GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/0, /*OpIdx*/0, // dst
494 // CHECK-NEXT:         GIR_AddTempRegister, /*InsnID*/0, /*TempRegID*/0, /*TempRegFlags*/0,
495 // CHECK-NEXT:         GIR_EraseFromParent, /*InsnID*/0,
496 // CHECK-NEXT:         GIR_CustomAction, GICXXCustomAction_CombineApplyGICombiner0,
497 // CHECK-NEXT:         GIR_Done,
498 // CHECK-NEXT:       // Label 7: @666
499 // CHECK-NEXT:       GIM_Try, /*On fail goto*//*Label 8*/ 745, // Rule ID 7 //
500 // CHECK-NEXT:         GIM_CheckSimplePredicate, GICXXPred_Simple_IsRule0Enabled,
501 // CHECK-NEXT:         // MIs[0] dst
502 // CHECK-NEXT:         // No operand predicates
503 // CHECK-NEXT:         // MIs[0] cst0
504 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
505 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/1, TargetOpcode::G_TRUNC,
506 // CHECK-NEXT:         // MIs[1] a.z
507 // CHECK-NEXT:         // No operand predicates
508 // CHECK-NEXT:         // MIs[0] tmp
509 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/2, /*MI*/0, /*OpIdx*/2, // MIs[2]
510 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/2, TargetOpcode::G_AND,
511 // CHECK-NEXT:         // MIs[2] cst1
512 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/3, /*MI*/2, /*OpIdx*/1, // MIs[3]
513 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/3, TargetOpcode::G_TRUNC,
514 // CHECK-NEXT:         // MIs[3] b.z
515 // CHECK-NEXT:         // No operand predicates
516 // CHECK-NEXT:         // MIs[2] cst2
517 // CHECK-NEXT:         GIM_RecordInsnIgnoreCopies, /*DefineMI*/4, /*MI*/2, /*OpIdx*/2, // MIs[4]
518 // CHECK-NEXT:         GIM_CheckOpcode, /*MI*/4, TargetOpcode::G_TRUNC,
519 // CHECK-NEXT:         // MIs[4] c.z
520 // CHECK-NEXT:         // No operand predicates
521 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner21,
522 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner22,
523 // CHECK-NEXT:         GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GICXXPred_MI_Predicate_GICombiner23,
524 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/1,
525 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/2,
526 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/3,
527 // CHECK-NEXT:         GIM_CheckIsSafeToFold, /*InsnID*/4,
528 // CHECK-NEXT:         GIR_MakeTempReg, /*TempRegID*/0, /*TypeID*/GILLT_s32,
529 // CHECK-NEXT:         GIR_BuildMI, /*InsnID*/1, /*Opcode*/TargetOpcode::G_CONSTANT,
530 // CHECK-NEXT:         GIR_AddTempRegister, /*InsnID*/1, /*TempRegID*/0, /*TempRegFlags*/0,
531 // CHECK-NEXT:         GIR_AddCImm, /*InsnID*/1, /*Type*/GILLT_s32, /*Imm*/0,
532 // CHECK-NEXT:         // Combiner Rule #0: Test0 @ [a[1], b[1], c[1]]
533 // CHECK-NEXT:         GIR_BuildMI, /*InsnID*/0, /*Opcode*/TargetOpcode::COPY,
534 // CHECK-NEXT:         GIR_Copy, /*NewInsnID*/0, /*OldInsnID*/0, /*OpIdx*/0, // dst
535 // CHECK-NEXT:         GIR_AddTempRegister, /*InsnID*/0, /*TempRegID*/0, /*TempRegFlags*/0,
536 // CHECK-NEXT:         GIR_EraseFromParent, /*InsnID*/0,
537 // CHECK-NEXT:         GIR_CustomAction, GICXXCustomAction_CombineApplyGICombiner0,
538 // CHECK-NEXT:         GIR_Done,
539 // CHECK-NEXT:       // Label 8: @745
540 // CHECK-NEXT:       GIM_Reject,
541 // CHECK-NEXT:     // Label 0: @746
542 // CHECK-NEXT:     GIM_Reject,
543 // CHECK-NEXT:     };
544 // CHECK-NEXT:   return MatchTable0;
545 // CHECK-NEXT: }