1 // RUN: llvm-tblgen -gen-global-isel -optimize-match-table=false -I %p/../../include -I %p/Common %s -o - < %s | FileCheck %s
3 include "llvm/Target/Target.td"
4 include "GlobalISelEmitterCommon.td"
6 def ADD : I<(outs GPR32:$dst), (ins GPR32:$src1, GPR32:$src2), []>;
8 //===- Test a simple pattern with frame index operands. ----------------------===//
10 // CHECK: GIM_Try, /*On fail goto*//*Label [[LABEL_NUM:[0-9]+]]*/ GIMT_Encode4([[LABEL:[0-9]+]]),
11 // CHECK-NEXT: GIM_CheckNumOperands, /*MI*/0, /*Expected*/2,
12 // CHECK-NEXT: GIM_CheckOpcode, /*MI*/0, GIMT_Encode2(TargetOpcode::G_FRAME_INDEX),
13 // CHECK-NEXT: // MIs[0] DstI[dst]
14 // CHECK-NEXT: GIM_RootCheckType, /*Op*/0, /*Type*/GILLT_p0s32,
15 // CHECK-NEXT: GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(MyTarget::GPR32RegClassID),
16 // CHECK-NEXT: // MIs[0] fi
17 // CHECK-NEXT: // No operand predicates
18 // CHECK-NEXT: // (frameindex:{ *:[i32] }):$fi => (ADD:{ *:[i32] } (tframeindex:{ *:[i32] }):$fi, 0:{ *:[i32] })
19 // CHECK-NEXT: GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(MyTarget::ADD),
20 // CHECK-NEXT: GIR_RootToRootCopy, /*OpIdx*/0, // DstI[dst]
21 // CHECK-NEXT: GIR_RootToRootCopy, /*OpIdx*/1, // fi
22 // CHECK-NEXT: GIR_AddImm8, /*InsnID*/0, /*Imm*/0,
23 // CHECK-NEXT: GIR_RootConstrainSelectedInstOperands,
24 // CHECK-NEXT: // GIR_Coverage, 0,
25 // CHECK-NEXT: GIR_EraseRootFromParent_Done,
26 // CHECK-NEXT: // Label [[LABEL_NUM]]: @[[LABEL]]
27 // CHECK-NEXT: GIM_Reject,
29 def : Pat<(p0 frameindex:$fi), (ADD tframeindex:$fi, 0)>;