150
|
1 // RUN: llvm-tblgen -gen-global-isel -I %p/../../include -I %p/Common %s -o %t
|
|
2 // RUN: FileCheck %s < %t
|
|
3
|
|
4 // Both predicates should be tested
|
|
5 // CHECK-DAG: GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIPFP_MI_Predicate_pat_frag_b,
|
|
6 // CHECK-DAG: GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIPFP_MI_Predicate_pat_frag_a,
|
|
7
|
|
8 include "llvm/Target/Target.td"
|
|
9 include "GlobalISelEmitterCommon.td"
|
|
10
|
|
11
|
|
12 def pat_frag_a : PatFrag <(ops node:$ptr), (load node:$ptr), [{}]> {
|
|
13 let PredicateCode = [{ return isInstA(MI); }];
|
|
14 let GISelPredicateCode = [{ return isInstA(MI); }];
|
|
15 }
|
|
16
|
|
17 def pat_frag_b : PatFrag <(ops node:$ptr), (load node:$ptr), [{}]> {
|
|
18 let PredicateCode = [{ return isInstB(MI); }];
|
|
19 let GISelPredicateCode = [{ return isInstB(MI); }];
|
|
20 }
|
|
21
|
|
22 def inst_a : Instruction {
|
|
23 let OutOperandList = (outs GPR32:$dst);
|
|
24 let InOperandList = (ins GPR32:$src);
|
|
25 }
|
|
26 def inst_b : Instruction {
|
|
27 let OutOperandList = (outs GPR32:$dst);
|
|
28 let InOperandList = (ins GPR32:$src);
|
|
29 }
|
|
30
|
|
31 def : Pat <
|
|
32 (pat_frag_a GPR32:$src),
|
|
33 (inst_a GPR32:$src)
|
|
34 >;
|
|
35
|
|
36 def : Pat <
|
|
37 (pat_frag_b GPR32:$src),
|
|
38 (inst_b GPR32:$src)
|
|
39 >;
|
|
40
|