1 // RUN: llvm-tblgen -I %p/../../../../include -gen-global-isel-combiner \
2 // RUN: -combiners=MyCombiner %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 Test0 : GICombineRule<
13 (match (G_STORE $a, $b):$mi),
14 (apply (GIEraseRoot))>;
16 def MyCombiner: GICombiner<"GenMyCombiner", [
20 // CHECK: const int64_t *GenMyCombiner::getMatchTable() const {
21 // CHECK-NEXT: constexpr static int64_t MatchTable0[] = {
22 // CHECK-NEXT: GIM_Try, /*On fail goto*//*Label 0*/ 10, // Rule ID 0 //
23 // CHECK-NEXT: GIM_CheckSimplePredicate, GICXXPred_Simple_IsRule0Enabled,
24 // CHECK-NEXT: GIM_CheckOpcode, /*MI*/0, TargetOpcode::G_STORE,
25 // CHECK-NEXT: // MIs[0] a
26 // CHECK-NEXT: // No operand predicates
27 // CHECK-NEXT: // MIs[0] b
28 // CHECK-NEXT: // No operand predicates
29 // CHECK-NEXT: // Combiner Rule #0: Test0
30 // CHECK-NEXT: GIR_EraseFromParent, /*InsnID*/0,
31 // CHECK-NEXT: GIR_Done,
32 // CHECK-NEXT: // Label 0: @10
33 // CHECK-NEXT: GIM_Reject,
35 // CHECK-NEXT: return MatchTable0;