| 1 |
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 6 |
| 2 |
// REQUIRES: amdgpu-registered-target |
| 3 |
// RUN: %clang_cc1 -triple amdgcn-unknown-unknown -target-cpu gfx1100 -DWMMA_GFX1100_TESTS -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-GFX1100 |
| 4 |
|
| 5 |
typedef float v8f __attribute__((ext_vector_type(8))); |
| 6 |
typedef half v16h __attribute__((ext_vector_type(16))); |
| 7 |
typedef int v2i __attribute__((ext_vector_type(2))); |
| 8 |
typedef int v4i __attribute__((ext_vector_type(4))); |
| 9 |
typedef int v8i __attribute__((ext_vector_type(8))); |
| 10 |
typedef short v16s __attribute__((ext_vector_type(16))); |
| 11 |
|
| 12 |
#ifdef WMMA_GFX1100_TESTS |
| 13 |
|
| 14 |
// Wave32 |
| 15 |
|
| 16 |
// |
| 17 |
// amdgcn_wmma_f32_16x16x16_f16 |
| 18 |
// |
| 19 |
|
| 20 |
// CHECK-GFX1100-LABEL: define dso_local void @test_amdgcn_wmma_f32_16x16x16_f16_w32( |
| 21 |
// CHECK-GFX1100-SAME: ptr addrspace(1) noundef writeonly captures(none) initializes((0, 32)) [[OUT:%.*]], <16 x half> noundef [[A:%.*]], <16 x half> noundef [[B:%.*]], <8 x float> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { |
| 22 |
// CHECK-GFX1100-NEXT: [[ENTRY:.*:]] |
| 23 |
// CHECK-GFX1100-NEXT: [[TMP0:%.*]] = tail call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.f16.v8f32.v16f16(<16 x half> [[A]], <16 x half> [[B]], <8 x float> [[C]]) |
| 24 |
// CHECK-GFX1100-NEXT: store <8 x float> [[TMP0]], ptr addrspace(1) [[OUT]], align 32, !tbaa [[CHAR_TBAA8:![0-9]+]] |
| 25 |
// CHECK-GFX1100-NEXT: ret void |
| 26 |
// |
| 27 |
void test_amdgcn_wmma_f32_16x16x16_f16_w32(global v8f* out, v16h a, v16h b, v8f c) |
| 28 |
{ |
| 29 |
*out = __builtin_amdgcn_wmma_f32_16x16x16_f16_w32(a, b, c); |
| 30 |
} |
| 31 |
|
| 32 |
// |
| 33 |
// amdgcn_wmma_f32_16x16x16_bf16 |
| 34 |
// |
| 35 |
|
| 36 |
// CHECK-GFX1100-LABEL: define dso_local void @test_amdgcn_wmma_f32_16x16x16_bf16_w32( |
| 37 |
// CHECK-GFX1100-SAME: ptr addrspace(1) noundef writeonly captures(none) initializes((0, 32)) [[OUT:%.*]], <16 x i16> noundef [[A:%.*]], <16 x i16> noundef [[B:%.*]], <8 x float> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 38 |
// CHECK-GFX1100-NEXT: [[ENTRY:.*:]] |
| 39 |
// CHECK-GFX1100-NEXT: [[TMP0:%.*]] = tail call <8 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf16.v8f32.v16i16(<16 x i16> [[A]], <16 x i16> [[B]], <8 x float> [[C]]) |
| 40 |
// CHECK-GFX1100-NEXT: store <8 x float> [[TMP0]], ptr addrspace(1) [[OUT]], align 32, !tbaa [[CHAR_TBAA8]] |
| 41 |
// CHECK-GFX1100-NEXT: ret void |
| 42 |
// |
| 43 |
void test_amdgcn_wmma_f32_16x16x16_bf16_w32(global v8f* out, v16s a, v16s b, v8f c) |
| 44 |
{ |
| 45 |
*out = __builtin_amdgcn_wmma_f32_16x16x16_bf16_w32(a, b, c); |
| 46 |
} |
| 47 |
|
| 48 |
// |
| 49 |
// amdgcn_wmma_f16_16x16x16_f16 |
| 50 |
// |
| 51 |
|
| 52 |
// CHECK-GFX1100-LABEL: define dso_local void @test_amdgcn_wmma_f16_16x16x16_f16_w32( |
| 53 |
// CHECK-GFX1100-SAME: ptr addrspace(1) noundef writeonly captures(none) initializes((0, 32)) [[OUT:%.*]], <16 x half> noundef [[A:%.*]], <16 x half> noundef [[B:%.*]], <16 x half> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 54 |
// CHECK-GFX1100-NEXT: [[ENTRY:.*:]] |
| 55 |
// CHECK-GFX1100-NEXT: [[TMP0:%.*]] = tail call <16 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16.v16f16.v16f16(<16 x half> [[A]], <16 x half> [[B]], <16 x half> [[C]], i1 true) |
| 56 |
// CHECK-GFX1100-NEXT: store <16 x half> [[TMP0]], ptr addrspace(1) [[OUT]], align 32, !tbaa [[CHAR_TBAA8]] |
| 57 |
// CHECK-GFX1100-NEXT: ret void |
| 58 |
// |
| 59 |
void test_amdgcn_wmma_f16_16x16x16_f16_w32(global v16h* out, v16h a, v16h b, v16h c) |
| 60 |
{ |
| 61 |
*out = __builtin_amdgcn_wmma_f16_16x16x16_f16_w32(a, b, c, true); |
| 62 |
} |
| 63 |
|
| 64 |
// |
| 65 |
// amdgcn_wmma_bf16_16x16x16_bf16 |
| 66 |
// |
| 67 |
|
| 68 |
// CHECK-GFX1100-LABEL: define dso_local void @test_amdgcn_wmma_bf16_16x16x16_bf16_w32( |
| 69 |
// CHECK-GFX1100-SAME: ptr addrspace(1) noundef writeonly captures(none) initializes((0, 32)) [[OUT:%.*]], <16 x i16> noundef [[A:%.*]], <16 x i16> noundef [[B:%.*]], <16 x i16> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 70 |
// CHECK-GFX1100-NEXT: [[ENTRY:.*:]] |
| 71 |
// CHECK-GFX1100-NEXT: [[TMP0:%.*]] = tail call <16 x i16> @llvm.amdgcn.wmma.bf16.16x16x16.bf16.v16i16.v16i16(<16 x i16> [[A]], <16 x i16> [[B]], <16 x i16> [[C]], i1 true) |
| 72 |
// CHECK-GFX1100-NEXT: store <16 x i16> [[TMP0]], ptr addrspace(1) [[OUT]], align 32, !tbaa [[CHAR_TBAA8]] |
| 73 |
// CHECK-GFX1100-NEXT: ret void |
| 74 |
// |
| 75 |
void test_amdgcn_wmma_bf16_16x16x16_bf16_w32(global v16s* out, v16s a, v16s b, v16s c) |
| 76 |
{ |
| 77 |
*out = __builtin_amdgcn_wmma_bf16_16x16x16_bf16_w32(a, b, c, true); |
| 78 |
} |
| 79 |
|
| 80 |
// |
| 81 |
// amdgcn_wmma_f16_16x16x16_f16_tied |
| 82 |
// |
| 83 |
|
| 84 |
// CHECK-GFX1100-LABEL: define dso_local void @test_amdgcn_wmma_f16_16x16x16_f16_tied_w32( |
| 85 |
// CHECK-GFX1100-SAME: ptr addrspace(1) noundef writeonly captures(none) initializes((0, 32)) [[OUT:%.*]], <16 x half> noundef [[A:%.*]], <16 x half> noundef [[B:%.*]], <16 x half> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 86 |
// CHECK-GFX1100-NEXT: [[ENTRY:.*:]] |
| 87 |
// CHECK-GFX1100-NEXT: [[TMP0:%.*]] = tail call <16 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16.tied.v16f16.v16f16(<16 x half> [[A]], <16 x half> [[B]], <16 x half> [[C]], i1 true) |
| 88 |
// CHECK-GFX1100-NEXT: store <16 x half> [[TMP0]], ptr addrspace(1) [[OUT]], align 32, !tbaa [[CHAR_TBAA8]] |
| 89 |
// CHECK-GFX1100-NEXT: ret void |
| 90 |
// |
| 91 |
void test_amdgcn_wmma_f16_16x16x16_f16_tied_w32(global v16h* out, v16h a, v16h b, v16h c) |
| 92 |
{ |
| 93 |
*out = __builtin_amdgcn_wmma_f16_16x16x16_f16_tied_w32(a, b, c, true); |
| 94 |
} |
| 95 |
|
| 96 |
// |
| 97 |
// amdgcn_wmma_bf16_16x16x16_bf16_tied |
| 98 |
// |
| 99 |
|
| 100 |
// CHECK-GFX1100-LABEL: define dso_local void @test_amdgcn_wmma_bf16_16x16x16_bf16_tied_w32( |
| 101 |
// CHECK-GFX1100-SAME: ptr addrspace(1) noundef writeonly captures(none) initializes((0, 32)) [[OUT:%.*]], <16 x i16> noundef [[A:%.*]], <16 x i16> noundef [[B:%.*]], <16 x i16> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 102 |
// CHECK-GFX1100-NEXT: [[ENTRY:.*:]] |
| 103 |
// CHECK-GFX1100-NEXT: [[TMP0:%.*]] = tail call <16 x i16> @llvm.amdgcn.wmma.bf16.16x16x16.bf16.tied.v16i16.v16i16(<16 x i16> [[A]], <16 x i16> [[B]], <16 x i16> [[C]], i1 true) |
| 104 |
// CHECK-GFX1100-NEXT: store <16 x i16> [[TMP0]], ptr addrspace(1) [[OUT]], align 32, !tbaa [[CHAR_TBAA8]] |
| 105 |
// CHECK-GFX1100-NEXT: ret void |
| 106 |
// |
| 107 |
void test_amdgcn_wmma_bf16_16x16x16_bf16_tied_w32(global v16s* out, v16s a, v16s b, v16s c) |
| 108 |
{ |
| 109 |
*out = __builtin_amdgcn_wmma_bf16_16x16x16_bf16_tied_w32(a, b, c, true); |
| 110 |
} |
| 111 |
|
| 112 |
// |
| 113 |
// amdgcn_wmma_i32_16x16x16_iu8 |
| 114 |
// |
| 115 |
|
| 116 |
// CHECK-GFX1100-LABEL: define dso_local void @test_amdgcn_wmma_i32_16x16x16_iu8_w32( |
| 117 |
// CHECK-GFX1100-SAME: ptr addrspace(1) noundef writeonly captures(none) initializes((0, 32)) [[OUT:%.*]], <4 x i32> noundef [[A:%.*]], <4 x i32> noundef [[B:%.*]], <8 x i32> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 118 |
// CHECK-GFX1100-NEXT: [[ENTRY:.*:]] |
| 119 |
// CHECK-GFX1100-NEXT: [[TMP0:%.*]] = tail call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8.v8i32.v4i32(i1 true, <4 x i32> [[A]], i1 true, <4 x i32> [[B]], <8 x i32> [[C]], i1 false) |
| 120 |
// CHECK-GFX1100-NEXT: store <8 x i32> [[TMP0]], ptr addrspace(1) [[OUT]], align 32, !tbaa [[CHAR_TBAA8]] |
| 121 |
// CHECK-GFX1100-NEXT: ret void |
| 122 |
// |
| 123 |
void test_amdgcn_wmma_i32_16x16x16_iu8_w32(global v8i* out, v4i a, v4i b, v8i c) |
| 124 |
{ |
| 125 |
*out = __builtin_amdgcn_wmma_i32_16x16x16_iu8_w32(true, a, true, b, c, false); |
| 126 |
} |
| 127 |
|
| 128 |
// |
| 129 |
// amdgcn_wmma_i32_16x16x16_iu4 |
| 130 |
// |
| 131 |
|
| 132 |
// CHECK-GFX1100-LABEL: define dso_local void @test_amdgcn_wmma_i32_16x16x16_iu4_w32( |
| 133 |
// CHECK-GFX1100-SAME: ptr addrspace(1) noundef writeonly captures(none) initializes((0, 32)) [[OUT:%.*]], <2 x i32> noundef [[A:%.*]], <2 x i32> noundef [[B:%.*]], <8 x i32> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 134 |
// CHECK-GFX1100-NEXT: [[ENTRY:.*:]] |
| 135 |
// CHECK-GFX1100-NEXT: [[TMP0:%.*]] = tail call <8 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4.v8i32.v2i32(i1 true, <2 x i32> [[A]], i1 true, <2 x i32> [[B]], <8 x i32> [[C]], i1 false) |
| 136 |
// CHECK-GFX1100-NEXT: store <8 x i32> [[TMP0]], ptr addrspace(1) [[OUT]], align 32, !tbaa [[CHAR_TBAA8]] |
| 137 |
// CHECK-GFX1100-NEXT: ret void |
| 138 |
// |
| 139 |
void test_amdgcn_wmma_i32_16x16x16_iu4_w32(global v8i* out, v2i a, v2i b, v8i c) |
| 140 |
{ |
| 141 |
*out = __builtin_amdgcn_wmma_i32_16x16x16_iu4_w32(true, a, true, b, c, false); |
| 142 |
} |
| 143 |
|
| 144 |
#endif |
| 145 |
//. |
| 146 |
// CHECK-GFX1100: [[META6:![0-9]+]] = !{!"omnipotent char", [[META7:![0-9]+]], i64 0} |
| 147 |
// CHECK-GFX1100: [[META7]] = !{!"Simple C/C++ TBAA"} |
| 148 |
// CHECK-GFX1100: [[CHAR_TBAA8]] = !{[[META6]], [[META6]], i64 0} |
| 149 |
//. |