brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.2 KiB · c227737 Raw
36 lines · plain
1// RUN: llvm-tblgen -I %p/../../../../include -gen-global-isel-combiner \2// RUN:     -combiners=MyCombiner %s | \3// RUN: FileCheck %s4 5include "llvm/Target/Target.td"6include "llvm/Target/GlobalISel/Combine.td"7 8def MyTargetISA : InstrInfo;9def MyTarget : Target { let InstructionSet = MyTargetISA; }10 11def Test0 : GICombineRule<12  (defs root:$mi),13  (match (G_STORE $a, $b):$mi),14  (apply (GIEraseRoot))>;15 16def 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] a26// CHECK-NEXT:       // No operand predicates27// CHECK-NEXT:       // MIs[0] b28// CHECK-NEXT:       // No operand predicates29// CHECK-NEXT:       // Combiner Rule #0: Test030// CHECK-NEXT:       GIR_EraseRootFromParent_Done,31// CHECK-NEXT:     // Label 0: @1332// CHECK-NEXT:     GIM_Reject,33// CHECK-NEXT:     };34// CHECK-NEXT:   return MatchTable0;35// CHECK-NEXT: }36