Revert "[msan] Add avx512-intrinsics.ll and avx512-intrinsics-upgrade.ll test case...
[llvm-project.git] / llvm / test / TableGen / GlobalISelEmitter / frameindex.td
blob27784526a65bad8e76223fbedd3f0366c3b18ef2
1 // RUN: llvm-tblgen -gen-global-isel -optimize-match-table=false -I %p/../../../include -I %p/../Common %s | FileCheck %s
3 include "llvm/Target/Target.td"
4 include "GlobalISelEmitterCommon.td"
6 def ADDI : I<(outs GPR32:$dst), (ins GPR32:$src1, i32imm:$src2), []>;
8 def to_tframeindex : SDNodeXForm<frameindex, [{}]>;
10 def : GICustomOperandRenderer<"renderFrameIndex">,
11       GISDNodeXFormEquiv<to_tframeindex>;
13 def : Pat<(frameindex:$fi), (ADDI (to_tframeindex $fi), 0)>;
15 def : Pat<(ptradd frameindex:$fi, (i32 imm:$offset)),
16           (ADDI (to_tframeindex $fi), imm:$offset)>;
18 // CHECK-LABEL: GIM_Try, /*On fail goto*//*Label 0*/ GIMT_Encode4(74), // Rule ID 1 //
19 // CHECK-NEXT: GIM_CheckNumOperands, /*MI*/0, /*Expected*/3,
20 // CHECK-NEXT: GIM_CheckOpcode, /*MI*/0, GIMT_Encode2(TargetOpcode::G_PTR_ADD),
21 // CHECK-NEXT: // MIs[0] DstI[dst]
22 // CHECK-NEXT: GIM_CheckPointerToAny, /*MI*/0, /*Op*/0, /*SizeInBits*/32,
23 // CHECK-NEXT: GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(MyTarget::GPR32RegClassID),
24 // CHECK-NEXT: // MIs[0] fi
25 // CHECK-NEXT: GIM_CheckPointerToAny, /*MI*/0, /*Op*/1, /*SizeInBits*/32,
26 // CHECK-NEXT: GIM_RecordInsn, /*DefineMI*/1, /*MI*/0, /*OpIdx*/1, // MIs[1]
27 // CHECK-NEXT: GIM_CheckNumOperands, /*MI*/1, /*Expected*/2,
28 // CHECK-NEXT: GIM_CheckOpcode, /*MI*/1, GIMT_Encode2(TargetOpcode::G_FRAME_INDEX),
29 // CHECK-NEXT: // MIs[1] Operand 0
30 // CHECK-NEXT: GIM_CheckPointerToAny, /*MI*/1, /*Op*/0, /*SizeInBits*/32,
31 // CHECK-NEXT: // MIs[1] Operand 1
32 // CHECK-NEXT: // No operand predicates
33 // CHECK-NEXT: // MIs[0] offset
34 // CHECK-NEXT: GIM_RootCheckType, /*Op*/2, /*Type*/GILLT_s32,
35 // CHECK-NEXT: GIM_RecordInsn, /*DefineMI*/2, /*MI*/0, /*OpIdx*/2, // MIs[2]
36 // CHECK-NEXT: GIM_CheckNumOperands, /*MI*/2, /*Expected*/2,
37 // CHECK-NEXT: GIM_CheckOpcode, /*MI*/2, GIMT_Encode2(TargetOpcode::G_CONSTANT),
38 // CHECK-NEXT: // MIs[2] Operand 0
39 // CHECK-NEXT: GIM_CheckType, /*MI*/2, /*Op*/0, /*Type*/GILLT_s32,
40 // CHECK-NEXT: // MIs[2] Operand 1
41 // CHECK-NEXT: // No operand predicates
42 // CHECK-NEXT: GIM_CheckIsSafeToFold, /*NumInsns*/2,
43 // CHECK-NEXT: // (ptradd:{ *:[i32] } (frameindex:{ *:[i32] }):$fi, (imm:{ *:[i32] }):$offset)  =>  (ADDI:{ *:[i32] } (to_tframeindex:{ *:[i32] } ?:{ *:[i32] }:$fi), (imm:{ *:[i32] }):$offset)
44 // CHECK-NEXT: GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(MyTarget::ADDI),
45 // CHECK-NEXT: GIR_RootToRootCopy, /*OpIdx*/0, // DstI[dst]
46 // CHECK-NEXT: GIR_CustomRenderer, /*InsnID*/0, /*OldInsnID*/1, /*Renderer*/GIMT_Encode2(GICR_renderFrameIndex), // fi
47 // CHECK-NEXT: GIR_CopyConstantAsSImm, /*NewInsnID*/0, /*OldInsnID*/2, // offset
48 // CHECK-NEXT: GIR_RootConstrainSelectedInstOperands,
49 // CHECK-NEXT: // GIR_Coverage, 1,
50 // CHECK-NEXT: GIR_EraseRootFromParent_Done,
52 // CHECK-LABEL: GIM_Try, /*On fail goto*//*Label 1*/ GIMT_Encode4(109), // Rule ID 0 //
53 // CHECK-NEXT: GIM_CheckNumOperands, /*MI*/0, /*Expected*/2,
54 // CHECK-NEXT: GIM_CheckOpcode, /*MI*/0, GIMT_Encode2(TargetOpcode::G_FRAME_INDEX),
55 // CHECK-NEXT: // MIs[0] DstI[dst]
56 // CHECK-NEXT: GIM_CheckPointerToAny, /*MI*/0, /*Op*/0, /*SizeInBits*/32,
57 // CHECK-NEXT: GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(MyTarget::GPR32RegClassID),
58 // CHECK-NEXT: // MIs[0] Operand 1
59 // CHECK-NEXT: // No operand predicates
60 // CHECK-NEXT: // (frameindex:{ *:[i32] }):$fi  =>  (ADDI:{ *:[i32] } (to_tframeindex:{ *:[i32] } ?:{ *:[i32] }:$fi), 0:{ *:[i32] })
61 // CHECK-NEXT: GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(MyTarget::ADDI),
62 // CHECK-NEXT: GIR_RootToRootCopy, /*OpIdx*/0, // DstI[dst]
63 // CHECK-NEXT: GIR_CustomRenderer, /*InsnID*/0, /*OldInsnID*/0, /*Renderer*/GIMT_Encode2(GICR_renderFrameIndex), // fi
64 // CHECK-NEXT: GIR_AddImm8, /*InsnID*/0, /*Imm*/0,
65 // CHECK-NEXT: GIR_RootConstrainSelectedInstOperands,
66 // CHECK-NEXT: // GIR_Coverage, 0,
67 // CHECK-NEXT: GIR_EraseRootFromParent_Done,