| 1 |
// RUN: llvm-tblgen -I %p/../../../../include -gen-global-isel-combiner \ |
| 2 |
// RUN: -combiners=MyCombiner %s | \ |
| 3 |
// RUN: FileCheck %s |
| 4 |
|
| 5 |
include "llvm/Target/Target.td" |
| 6 |
include "llvm/Target/GlobalISel/Combine.td" |
| 7 |
|
| 8 |
def MyTargetISA : InstrInfo; |
| 9 |
def MyTarget : Target { let InstructionSet = MyTargetISA; } |
| 10 |
|
| 11 |
def Test0 : GICombineRule< |
| 12 |
(defs root:$mi), |
| 13 |
(match (G_STORE $a, $b):$mi), |
| 14 |
(apply (GIEraseRoot))>; |
| 15 |
|
| 16 |
def MyCombiner: GICombiner<"GenMyCombiner", [ |
| 17 |
Test0, |
| 18 |
]>; |
| 19 |
|
| 20 |
// CHECK: const uint8_t *GenMyCombiner::getMatchTable() const { |
| 21 |
// CHECK-NEXT: constexpr static uint8_t MatchTable0[] = { |
| 22 |
// CHECK-NEXT: GIM_Try, /*On fail goto*//*Label 0*/ GIMT_Encode4(13), // Rule ID 0 // |
| 23 |
// CHECK-NEXT: GIM_CheckSimplePredicate, GIMT_Encode2(GICXXPred_Simple_IsRule0Enabled), |
| 24 |
// CHECK-NEXT: GIM_CheckOpcode, /*MI*/0, GIMT_Encode2(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_EraseRootFromParent_Done, |
| 31 |
// CHECK-NEXT: // Label 0: @13 |
| 32 |
// CHECK-NEXT: GIM_Reject, |
| 33 |
// CHECK-NEXT: }; |
| 34 |
// CHECK-NEXT: return MatchTable0; |
| 35 |
// CHECK-NEXT: } |