Revert "[msan] Add avx512-intrinsics.ll and avx512-intrinsics-upgrade.ll test case...
[llvm-project.git] / llvm / test / TableGen / GlobalISelEmitter / OverloadedPtr.td
blob43a121f94bd6cb17d3f1fedf11b04949be8b8a17
1 // RUN: llvm-tblgen -gen-global-isel -I %p/../../../include -I %p/../Common %s | FileCheck %s
3 // Boilerplate code.
4 include "llvm/Target/Target.td"
5 include "GlobalISelEmitterCommon.td"
7 def GPR : RegisterClass<"MyTarget", [i32, i64], 32, (add R0)>;
9 let TargetPrefix = "mytarget" in {
10     def int_mytarget_anyptr : Intrinsic<[llvm_i32_ty], [llvm_anyptr_ty]>;
13 // Check that iPTR in the destination DAG doesn't prevent the pattern from being imported.
15 // CHECK: GIM_RootCheckType, /*Op*/0, /*Type*/GILLT_s32,
16 // CHECK-NEXT: GIM_CheckAtomicOrdering, /*MI*/0, /*Order*/(uint8_t)AtomicOrdering::NotAtomic,
17 // CHECK-NEXT: GIM_CheckMemorySizeEqualToLLT, /*MI*/0, /*MMO*/0, /*OpIdx*/0,
18 // CHECK-NEXT: GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(MyTarget::GPR32RegClassID),
19 // CHECK-NEXT: // MIs[0] src1
20 // CHECK-NEXT: GIM_CheckPointerToAny, /*MI*/0, /*Op*/1, /*SizeInBits*/0,
21 // CHECK-NEXT: GIM_RootCheckRegBankForClass, /*Op*/1, /*RC*/GIMT_Encode2(MyTarget::GPRRegClassID),
22 // CHECK-NEXT: // (ld:{ *:[i32] } GPR:{ *:[iPTR] }:$src1)<<P:Predicate_unindexedload>><<P:Predicate_load>>  =>  (ANYLOAD:{ *:[i32] } GPR:{ *:[iPTR] }:$src1)
23 // CHECK-NEXT: GIR_MutateOpcode, /*InsnID*/0, /*RecycleInsnID*/0, /*Opcode*/GIMT_Encode2(MyTarget::ANYLOAD),
24 // CHECK-NEXT: GIR_RootConstrainSelectedInstOperands,
25 // CHECK-NEXT: // GIR_Coverage, 0,
26 // CHECK-NEXT: GIR_Done,
28 let hasSideEffects = 1 in {
29   def ANYLOAD : I<(outs GPR32:$dst), (ins GPR:$src1),
30                   [(set GPR32:$dst, (load GPR:$src1))]>;
33 // Ensure that llvm_anyptr_ty on an intrinsic results in a
34 // GIM_CheckPointerToAny rather than a GIM_CheckType.
36 // CHECK: GIM_CheckIntrinsicID, /*MI*/0, /*Op*/1, GIMT_Encode2(Intrinsic::mytarget_anyptr),
37 // CHECK-NEXT: GIM_RootCheckType, /*Op*/0, /*Type*/GILLT_s32,
38 // CHECK-NEXT: GIM_RootCheckRegBankForClass, /*Op*/0, /*RC*/GIMT_Encode2(MyTarget::GPR32RegClassID),
39 // CHECK-NEXT: // MIs[0] src
40 // CHECK-NEXT: GIM_CheckPointerToAny, /*MI*/0, /*Op*/2, /*SizeInBits*/32,
41 // CHECK-NEXT: GIM_RootCheckRegBankForClass, /*Op*/2, /*RC*/GIMT_Encode2(MyTarget::GPR32RegClassID),
42 // CHECK-NEXT: GIM_CheckCxxInsnPredicate, /*MI*/0, /*FnId*/GIMT_Encode2(GICXXPred_MI_Predicate_frag_anyptr),
43 // CHECK-NEXT: // (intrinsic_w_chain:{ *:[i32] } {{[0-9]+}}:{ *:[iPTR] }, GPR32:{ *:[i32] }:$src)<<P:Predicate_frag_anyptr>>  =>  (ANYLOAD:{ *:[i32] } GPR32:{ *:[i32] }:$src)
44 // CHECK-NEXT: GIR_BuildRootMI, /*Opcode*/GIMT_Encode2(MyTarget::ANYLOAD),
46 def frag_anyptr : PatFrag<(ops node:$src),
47                    (int_mytarget_anyptr node:$src),
48                    [{ return true; // C++ code }]> {
49   let GISelPredicateCode = [{ return true; // C++ code }];
52 def : Pat<(frag_anyptr GPR32:$src),
53           (p0 (ANYLOAD GPR32:$src))>;