[TableGen] Fix validateOperandClass for non Phyical Reg (#118146)
[llvm-project.git] / llvm / test / TableGen / GlobalISelEmitterCustomPredicate.td
blob3ceadf32f06425e7818fceb86a6e9f30f3f3905d
1 // RUN: llvm-tblgen %s -gen-global-isel -optimize-match-table=false -I %p/../../include -I %p/Common -o - | FileCheck %s
3 // Verify that all MI predicates are enumerated.
4 //
5 // CHECK: // PatFrag predicates.
6 // CHECK-NEXT: enum {
7 // CHECK-NEXT:   GICXXPred_MI_Predicate_and_or_pat = GICXXPred_Invalid + 1,
8 // CHECK-NEXT:   GICXXPred_MI_Predicate_mul_pat,
9 // CHECK-NEXT:   GICXXPred_MI_Predicate_or_oneuse,
10 // CHECK-NEXT:   GICXXPred_MI_Predicate_patfrags_test_pat,
11 // CHECK-NEXT:   GICXXPred_MI_Predicate_sub3_pat,
12 // CHECK-NEXT: };
14 // Verify that we emit cases for all MI predicates.
16 // CHECK: bool MyTargetInstructionSelector::testMIPredicate_MI(
17 // CHECK:    case GICXXPred_MI_Predicate_and_or_pat: {
18 // CHECK:      return doesComplexCheck(MI);
19 // CHECK:    case GICXXPred_MI_Predicate_mul_pat: {
20 // CHECK:      return doesComplexCheck(MI);
21 // CHECK:    case GICXXPred_MI_Predicate_or_oneuse: {
22 // CHECK:      return MRI.hasOneNonDBGUse(MI.getOperand(0).getReg());
23 // CHECK:    case GICXXPred_MI_Predicate_patfrags_test_pat: {
24 // CHECK:      return doesComplexCheck(MI);
25 // CHECK:    case GICXXPred_MI_Predicate_sub3_pat: {
26 // CHECK:      return doesComplexCheck(MI);
28 include "llvm/Target/Target.td"
29 include "GlobalISelEmitterCommon.td"
31 // Boilerplate code for setting up some registers with subregs.
32 class MyReg<string n, list<Register> subregs = []>
33   : Register<n> {
34   let SubRegs = subregs;
37 class MyClass<int size, list<ValueType> types, dag registers>
38   : RegisterClass<"Test", types, size, registers> {
39   let Size = size;
42 def sub0 : SubRegIndex<16>;
43 def sub1 : SubRegIndex<16, 16>;
44 def S0 : MyReg<"s0">;
45 def S1 : MyReg<"s1">;
46 def SRegs : MyClass<16, [i16], (sequence "S%u", 0, 1)>;
48 let SubRegIndices = [sub0, sub1] in {
49 def D0 : MyReg<"d0", [S0, S1]>;
52 def DRegs : MyClass<32, [i32], (sequence "D%u", 0, 0)>;
53 def DOP : RegisterOperand<DRegs>;
54 def AND_OR : I<(outs DRegs:$dst), (ins DOP:$src0, DOP:$src1, DOP:$src2), []>;
55 def MUL_OR : I<(outs DRegs:$dst), (ins DOP:$src0, DOP:$src1, DOP:$src2), []>;
57 def or_oneuse : PatFrag<
58   (ops node:$x, node:$y),
59   (or node:$x, node:$y), [{ return foo(); }]> {
60   let GISelPredicateCode = [{
61     return MRI.hasOneNonDBGUse(MI.getOperand(0).getReg());
62   }];
66 // FIXME: GISelPredicateCode ignored if DAG predicate not set.
67 def and_or_pat : PatFrag<
68   (ops node:$x, node:$y, node:$z),
69   (and (or node:$x, node:$y), node:$z), [{ return foo(); }]> {
70   let GISelPredicateCode = [{
71     return doesComplexCheck(MI);
72   }];
73   let PredicateCodeUsesOperands = 1;
76 // CHECK:      GIM_Try, /*On fail goto*//*Label 0*/ GIMT_Encode4(97), // Rule ID 7 //
77 // CHECK-NEXT:   GIM_CheckNumOperands, /*MI*/0, /*Expected*/3,
78 // CHECK-NEXT:   GIM_CheckOpcode, /*MI*/0, GIMT_Encode2(TargetOpcode::G_AND),
79 // CHECK-NEXT:   // MIs[0] DstI[dst]
80 // CHECK-NEXT:   GIM_RootCheckType, /*Op*/0, /*Type*/GILLT_s32,
81 // CHECK-NEXT:   GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(Test::DRegsRegClassID),
82 // CHECK-NEXT:   // MIs[0] src2
83 // CHECK-NEXT:   GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
84 // CHECK-NEXT:   GIM_RecordNamedOperand, /*MI*/0, /*Op*/1, /*StoreIdx*/2, // Name : pred:3:z
85 // CHECK-NEXT:   GIM_RootCheckRegBankForClass, /*Op*/1, /*RC*/GIMT_Encode2(Test::DRegsRegClassID),
86 // CHECK-NEXT:   // MIs[0] Operand 2
87 // CHECK-NEXT:   GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s32,
88 // CHECK-NEXT:   GIM_RecordInsn, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1]
89 // CHECK-NEXT:   GIM_CheckNumOperands, /*MI*/1, /*Expected*/3,
90 // CHECK-NEXT:   GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_OR),
91 // CHECK-NEXT:   // MIs[1] Operand 0
92 // CHECK-NEXT:   GIM_CheckType, /*MI*/1, /*Op*/0, /*Type*/GILLT_s32,
93 // CHECK-NEXT:   // MIs[1] src0
94 // CHECK-NEXT:   GIM_CheckType, /*MI*/1, /*Op*/1, /*Type*/GILLT_s32,
95 // CHECK-NEXT:   GIM_RecordNamedOperand, /*MI*/1, /*Op*/1, /*StoreIdx*/0, // Name : pred:3:x
96 // CHECK-NEXT:   GIM_CheckRegBankForClass, /*MI*/1, /*Op*/1, /*RC*/GIMT_Encode2(Test::DRegsRegClassID),
97 // CHECK-NEXT:   // MIs[1] src1
98 // CHECK-NEXT:   GIM_CheckType, /*MI*/1, /*Op*/2, /*Type*/GILLT_s32,
99 // CHECK-NEXT:   GIM_RecordNamedOperand, /*MI*/1, /*Op*/2, /*StoreIdx*/1, // Name : pred:3:y
100 // CHECK-NEXT:   GIM_CheckRegBankForClass, /*MI*/1, /*Op*/2, /*RC*/GIMT_Encode2(Test::DRegsRegClassID),
101 // CHECK-NEXT:   GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_and_or_pat),
102 // CHECK-NEXT:   GIM_CheckIsSafeToFold, /*NumInsns*/1,
103 // CHECK-NEXT:   // (and:{ *:[i32] } DOP:{ *:[i32] }:$src2:$pred:3:z, (or:{ *:[i32] } DOP:{ *:[i32] }:$src0:$pred:3:x, DOP:{ *:[i32] }:$src1:$pred:3:y))<<P:3:Predicate_and_or_pat>>  =>  (AND_OR:{ *:[i32] } DOP:{ *:[i32] }:$src0, DOP:{ *:[i32] }:$src1, DOP:{ *:[i32] }:$src2)
104 // CHECK-NEXT:   GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(MyTarget::AND_OR),
106 // CHECK:      GIM_Try, /*On fail goto*//*Label 1*/ GIMT_Encode4(194), // Rule ID 3 //
107 // CHECK-NEXT:   GIM_CheckNumOperands, /*MI*/0, /*Expected*/3,
108 // CHECK-NEXT:   GIM_CheckOpcode, /*MI*/0, GIMT_Encode2(TargetOpcode::G_AND),
109 // CHECK-NEXT:   // MIs[0] DstI[dst]
110 // CHECK-NEXT:   GIM_RootCheckType, /*Op*/0, /*Type*/GILLT_s32,
111 // CHECK-NEXT:   GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(Test::DRegsRegClassID),
112 // CHECK-NEXT:   // MIs[0] Operand 1
113 // CHECK-NEXT:   GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
114 // CHECK-NEXT:   GIM_RecordInsn, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
115 // CHECK-NEXT:   GIM_CheckNumOperands, /*MI*/1, /*Expected*/3,
116 // CHECK-NEXT:   GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_OR),
117 // CHECK-NEXT:   // MIs[1] Operand 0
118 // CHECK-NEXT:   GIM_CheckType, /*MI*/1, /*Op*/0, /*Type*/GILLT_s32,
119 // CHECK-NEXT:   // MIs[1] src0
120 // CHECK-NEXT:   GIM_CheckType, /*MI*/1, /*Op*/1, /*Type*/GILLT_s32,
121 // CHECK-NEXT:   GIM_RecordNamedOperand, /*MI*/1, /*Op*/1, /*StoreIdx*/0, // Name : pred:3:x
122 // CHECK-NEXT:   GIM_CheckRegBankForClass, /*MI*/1, /*Op*/1, /*RC*/GIMT_Encode2(Test::DRegsRegClassID),
123 // CHECK-NEXT:   // MIs[1] src1
124 // CHECK-NEXT:   GIM_CheckType, /*MI*/1, /*Op*/2, /*Type*/GILLT_s32,
125 // CHECK-NEXT:   GIM_RecordNamedOperand, /*MI*/1, /*Op*/2, /*StoreIdx*/1, // Name : pred:3:y
126 // CHECK-NEXT:   GIM_CheckRegBankForClass, /*MI*/1, /*Op*/2, /*RC*/GIMT_Encode2(Test::DRegsRegClassID),
127 // CHECK-NEXT:   // MIs[0] src2
128 // CHECK-NEXT:   GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s32,
129 // CHECK-NEXT:   GIM_RecordNamedOperand, /*MI*/0, /*Op*/2, /*StoreIdx*/2, // Name : pred:3:z
130 // CHECK-NEXT:   GIM_RootCheckRegBankForClass, /*Op*/2, /*RC*/GIMT_Encode2(Test::DRegsRegClassID),
131 // CHECK-NEXT:   GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_and_or_pat),
132 // CHECK-NEXT:   GIM_CheckIsSafeToFold, /*NumInsns*/1,
133 // CHECK-NEXT:   // (and:{ *:[i32] } (or:{ *:[i32] } DOP:{ *:[i32] }:$src0:$pred:3:x, DOP:{ *:[i32] }:$src1:$pred:3:y), DOP:{ *:[i32] }:$src2:$pred:3:z)<<P:3:Predicate_and_or_pat>>  =>  (AND_OR:{ *:[i32] } DOP:{ *:[i32] }:$src0, DOP:{ *:[i32] }:$src1, DOP:{ *:[i32] }:$src2)
134 // CHECK-NEXT:   GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(MyTarget::AND_OR),
136 // Test commutative, standalone pattern.
137 def : Pat<
138   (i32 (and_or_pat DOP:$src0, DOP:$src1, DOP:$src2)),
139   (AND_OR DOP:$src0, DOP:$src1, DOP:$src2)
142 def mul_pat : PatFrag<
143   (ops node:$x, node:$y),
144   (mul node:$x, node:$y), [{ return foo(); }]> {
145   let GISelPredicateCode = [{
146     return doesComplexCheck(MI);
147   }];
148   let PredicateCodeUsesOperands = 1;
151 // CHECK:      GIM_Try, /*On fail goto*//*Label 2*/ GIMT_Encode4(287), // Rule ID 4 //
152 // CHECK-NEXT:   GIM_CheckNumOperands, /*MI*/0, /*Expected*/3,
153 // CHECK-NEXT:   GIM_CheckOpcode, /*MI*/0, GIMT_Encode2(TargetOpcode::G_MUL),
154 // CHECK-NEXT:   // MIs[0] DstI[dst]
155 // CHECK-NEXT:   GIM_RootCheckType, /*Op*/0, /*Type*/GILLT_s32,
156 // CHECK-NEXT:   GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(Test::DRegsRegClassID),
157 // CHECK-NEXT:   // MIs[0] Operand 1
158 // CHECK-NEXT:   GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
159 // CHECK-NEXT:   GIM_RecordNamedOperand, /*MI*/0, /*Op*/1, /*StoreIdx*/0, // Name : pred:4:x
160 // CHECK-NEXT:   GIM_RecordInsn, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
161 // CHECK-NEXT:   GIM_CheckNumOperands, /*MI*/1, /*Expected*/3,
162 // CHECK-NEXT:   GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_OR),
163 // CHECK-NEXT:   // MIs[1] Operand 0
164 // CHECK-NEXT:   GIM_CheckType, /*MI*/1, /*Op*/0, /*Type*/GILLT_s32,
165 // CHECK-NEXT:   // MIs[1] src0
166 // CHECK-NEXT:   GIM_CheckType, /*MI*/1, /*Op*/1, /*Type*/GILLT_s32,
167 // CHECK-NEXT:   GIM_CheckRegBankForClass, /*MI*/1, /*Op*/1, /*RC*/GIMT_Encode2(Test::DRegsRegClassID),
168 // CHECK-NEXT:   // MIs[1] src1
169 // CHECK-NEXT:   GIM_CheckType, /*MI*/1, /*Op*/2, /*Type*/GILLT_s32,
170 // CHECK-NEXT:   GIM_CheckRegBankForClass, /*MI*/1, /*Op*/2, /*RC*/GIMT_Encode2(Test::DRegsRegClassID),
171 // CHECK-NEXT:   // MIs[0] src2
172 // CHECK-NEXT:   GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s32,
173 // CHECK-NEXT:   GIM_RecordNamedOperand, /*MI*/0, /*Op*/2, /*StoreIdx*/1, // Name : pred:4:y
174 // CHECK-NEXT:   GIM_RootCheckRegBankForClass, /*Op*/2, /*RC*/GIMT_Encode2(Test::DRegsRegClassID),
175 // CHECK-NEXT:   GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_mul_pat),
176 // CHECK-NEXT:   GIM_CheckIsSafeToFold, /*NumInsns*/1,
177 // CHECK-NEXT:   // (mul:{ *:[i32] } (or:{ *:[i32] } DOP:{ *:[i32] }:$src0, DOP:{ *:[i32] }:$src1):$pred:4:x, DOP:{ *:[i32] }:$src2:$pred:4:y)<<P:4:Predicate_mul_pat>>  =>  (MUL_OR:{ *:[i32] } DOP:{ *:[i32] }:$src0, DOP:{ *:[i32] }:$src1, DOP:{ *:[i32] }:$src2)
178 // CHECK-NEXT:   GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(MyTarget::MUL_OR),
180 // CHECK:      GIM_Try, /*On fail goto*//*Label 3*/ GIMT_Encode4(380), // Rule ID 8 //
181 // CHECK-NEXT:   GIM_CheckNumOperands, /*MI*/0, /*Expected*/3,
182 // CHECK-NEXT:   GIM_CheckOpcode, /*MI*/0, GIMT_Encode2(TargetOpcode::G_MUL),
183 // CHECK-NEXT:   // MIs[0] DstI[dst]
184 // CHECK-NEXT:   GIM_RootCheckType, /*Op*/0, /*Type*/GILLT_s32,
185 // CHECK-NEXT:   GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(Test::DRegsRegClassID),
186 // CHECK-NEXT:   // MIs[0] src2
187 // CHECK-NEXT:   GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
188 // CHECK-NEXT:   GIM_RecordNamedOperand, /*MI*/0, /*Op*/1, /*StoreIdx*/1, // Name : pred:4:y
189 // CHECK-NEXT:   GIM_RootCheckRegBankForClass, /*Op*/1, /*RC*/GIMT_Encode2(Test::DRegsRegClassID),
190 // CHECK-NEXT:   // MIs[0] Operand 2
191 // CHECK-NEXT:   GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s32,
192 // CHECK-NEXT:   GIM_RecordNamedOperand, /*MI*/0, /*Op*/2, /*StoreIdx*/0, // Name : pred:4:x
193 // CHECK-NEXT:   GIM_RecordInsn, /*DefineMI*/1, /*MI*/0, /*OpIdx*/2, // MIs[1]
194 // CHECK-NEXT:   GIM_CheckNumOperands, /*MI*/1, /*Expected*/3,
195 // CHECK-NEXT:   GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_OR),
196 // CHECK-NEXT:   // MIs[1] Operand 0
197 // CHECK-NEXT:   GIM_CheckType, /*MI*/1, /*Op*/0, /*Type*/GILLT_s32,
198 // CHECK-NEXT:   // MIs[1] src0
199 // CHECK-NEXT:   GIM_CheckType, /*MI*/1, /*Op*/1, /*Type*/GILLT_s32,
200 // CHECK-NEXT:   GIM_CheckRegBankForClass, /*MI*/1, /*Op*/1, /*RC*/GIMT_Encode2(Test::DRegsRegClassID),
201 // CHECK-NEXT:   // MIs[1] src1
202 // CHECK-NEXT:   GIM_CheckType, /*MI*/1, /*Op*/2, /*Type*/GILLT_s32,
203 // CHECK-NEXT:   GIM_CheckRegBankForClass, /*MI*/1, /*Op*/2, /*RC*/GIMT_Encode2(Test::DRegsRegClassID),
204 // CHECK-NEXT:   GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_mul_pat),
205 // CHECK-NEXT:   GIM_CheckIsSafeToFold, /*NumInsns*/1,
206 // CHECK-NEXT:   // (mul:{ *:[i32] } DOP:{ *:[i32] }:$src2:$pred:4:y, (or:{ *:[i32] } DOP:{ *:[i32] }:$src0, DOP:{ *:[i32] }:$src1):$pred:4:x)<<P:4:Predicate_mul_pat>>  =>  (MUL_OR:{ *:[i32] } DOP:{ *:[i32] }:$src0, DOP:{ *:[i32] }:$src1, DOP:{ *:[i32] }:$src2)
207 // CHECK-NEXT:   GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(MyTarget::MUL_OR),
209 // Test commutative patterns where named operands in the source pattern are not
210 // directly bound to PatFrag's operands.
211 def : Pat<
212   (i32 (mul_pat (or DOP:$src0, DOP:$src1), DOP:$src2)),
213   (MUL_OR DOP:$src0, DOP:$src1, DOP:$src2)
216 def sub3_pat : PatFrag<
217   (ops node:$x, node:$y, node:$z),
218   (sub (sub node:$x, node:$y), node:$z), [{ return foo(); }]> {
219   let GISelPredicateCode = [{
220     return doesComplexCheck(MI);
221   }];
223   let PredicateCodeUsesOperands = 1;
226 // CHECK:      GIM_Try, /*On fail goto*//*Label 4*/ GIMT_Encode4(463), // Rule ID 0 //
227 // CHECK-NEXT:   GIM_CheckNumOperands, /*MI*/0, /*Expected*/3,
228 // CHECK-NEXT:   GIM_CheckOpcode, /*MI*/0, GIMT_Encode2(TargetOpcode::G_SUB),
229 // CHECK-NEXT:   // MIs[0] DstI[dst]
230 // CHECK-NEXT:   GIM_RootCheckType, /*Op*/0, /*Type*/GILLT_s32,
231 // CHECK-NEXT:   GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(Test::DRegsRegClassID),
232 // CHECK-NEXT:   // MIs[0] Operand 1
233 // CHECK-NEXT:   GIM_RootCheckType, /*Op*/1, /*Type*/GILLT_s32,
234 // CHECK-NEXT:   GIM_RecordInsn, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
235 // CHECK-NEXT:   GIM_CheckNumOperands, /*MI*/1, /*Expected*/3,
236 // CHECK-NEXT:   GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_SUB),
237 // CHECK-NEXT:   // MIs[1] Operand 0
238 // CHECK-NEXT:   GIM_CheckType, /*MI*/1, /*Op*/0, /*Type*/GILLT_s32,
239 // CHECK-NEXT:   // MIs[1] src0
240 // CHECK-NEXT:   GIM_CheckType, /*MI*/1, /*Op*/1, /*Type*/GILLT_s32,
241 // CHECK-NEXT:   GIM_RecordNamedOperand, /*MI*/1, /*Op*/1, /*StoreIdx*/0, // Name : pred:1:x
242 // CHECK-NEXT:   // MIs[1] src1
243 // CHECK-NEXT:   GIM_CheckType, /*MI*/1, /*Op*/2, /*Type*/GILLT_s32,
244 // CHECK-NEXT:   GIM_RecordNamedOperand, /*MI*/1, /*Op*/2, /*StoreIdx*/1, // Name : pred:1:y
245 // CHECK-NEXT:   // MIs[0] src2
246 // CHECK-NEXT:   GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s32,
247 // CHECK-NEXT:   GIM_RecordNamedOperand, /*MI*/0, /*Op*/2, /*StoreIdx*/2, // Name : pred:1:z
248 // CHECK-NEXT:   GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_sub3_pat),
249 // CHECK-NEXT:   GIM_CheckIsSafeToFold, /*NumInsns*/1,
250 // CHECK-NEXT:   // (sub:{ *:[i32] } (sub:{ *:[i32] } i32:{ *:[i32] }:$src0:$pred:1:x, i32:{ *:[i32] }:$src1:$pred:1:y), i32:{ *:[i32] }:$src2:$pred:1:z)<<P:1:Predicate_sub3_pat>>  =>  (SUB3:{ *:[i32] } i32:{ *:[i32] }:$src0, i32:{ *:[i32] }:$src1, i32:{ *:[i32] }:$src2)
251 // CHECK-NEXT:   GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(MyTarget::SUB3)
253 // Test a non-commutative pattern.
254 def SUB3 : I<(outs DRegs:$dst),
255   (ins DOP:$src0, DOP:$src1, DOP:$src2),
256   [(set DRegs:$dst, (sub3_pat i32:$src0, i32:$src1, i32:$src2))]
260 def patfrags_test_pat : PatFrags<
261   (ops node:$x, node:$y, node:$z),
262   [ (xor (add node:$x, node:$y), node:$z),
263     (xor (sub node:$x, node:$y), node:$z)
264   ], [{ return foo(); }]> {
265   let GISelPredicateCode = [{
266     return doesComplexCheck(MI);
267   }];
269   let PredicateCodeUsesOperands = 1;
272 // CHECK: GIM_Try, /*On fail goto*//*Label 5*/ GIMT_Encode4(546), // Rule ID 1 //
273 // CHECK: // (xor:{ *:[i32] } (add:{ *:[i32] } i32:{ *:[i32] }:$src0:$pred:2:x, i32:{ *:[i32] }:$src1:$pred:2:y), i32:{ *:[i32] }:$src2:$pred:2:z)<<P:2:Predicate_patfrags_test_pat>>  =>  (PATFRAGS:{ *:[i32] } i32:{ *:[i32] }:$src0, i32:{ *:[i32] }:$src1, i32:{ *:[i32] }:$src2)
275 // CHECK: GIM_Try, /*On fail goto*//*Label 6*/ GIMT_Encode4(629), // Rule ID 2 //
276 // CHECK: // (xor:{ *:[i32] } (sub:{ *:[i32] } i32:{ *:[i32] }:$src0:$pred:2:x, i32:{ *:[i32] }:$src1:$pred:2:y), i32:{ *:[i32] }:$src2:$pred:2:z)<<P:2:Predicate_patfrags_test_pat>>  =>  (PATFRAGS:{ *:[i32] } i32:{ *:[i32] }:$src0, i32:{ *:[i32] }:$src1, i32:{ *:[i32] }:$src2)
278 // CHECK: GIM_Try, /*On fail goto*//*Label 7*/ GIMT_Encode4(712), // Rule ID 5 //
279 // CHECK: // (xor:{ *:[i32] } i32:{ *:[i32] }:$src2:$pred:2:z, (add:{ *:[i32] } i32:{ *:[i32] }:$src0:$pred:2:x, i32:{ *:[i32] }:$src1:$pred:2:y))<<P:2:Predicate_patfrags_test_pat>>  =>  (PATFRAGS:{ *:[i32] } i32:{ *:[i32] }:$src0, i32:{ *:[i32] }:$src1, i32:{ *:[i32] }:$src2)
281 // CHECK: GIM_Try, /*On fail goto*//*Label 8*/ GIMT_Encode4(795), // Rule ID 6 //
282 // CHECK: // (xor:{ *:[i32] } i32:{ *:[i32] }:$src2:$pred:2:z, (sub:{ *:[i32] } i32:{ *:[i32] }:$src0:$pred:2:x, i32:{ *:[i32] }:$src1:$pred:2:y))<<P:2:Predicate_patfrags_test_pat>>  =>  (PATFRAGS:{ *:[i32] } i32:{ *:[i32] }:$src0, i32:{ *:[i32] }:$src1, i32:{ *:[i32] }:$src2)
285 // Test a commutative pattern using multiple patterns using PatFrags.
286 def PATFRAGS : I<(outs DRegs:$dst),
287   (ins DOP:$src0, DOP:$src1, DOP:$src2),
288   [(set DRegs:$dst, (patfrags_test_pat i32:$src0, i32:$src1, i32:$src2))]