| 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 gfx1200 -target-feature +wavefrontsize64 -emit-llvm -o - %s | FileCheck %s --check-prefix=CHECK-GFX1200 |
| 4 |
|
| 5 |
typedef float v4f __attribute__((ext_vector_type(4))); |
| 6 |
typedef half v4h __attribute__((ext_vector_type(4))); |
| 7 |
typedef short v4s __attribute__((ext_vector_type(4))); |
| 8 |
typedef int v4i __attribute__((ext_vector_type(4))); |
| 9 |
|
| 10 |
// Wave64 |
| 11 |
|
| 12 |
// |
| 13 |
// amdgcn_wmma_f32_16x16x16_f16 |
| 14 |
// |
| 15 |
|
| 16 |
// CHECK-GFX1200-LABEL: define dso_local void @test_amdgcn_wmma_f32_16x16x16_f16_w64( |
| 17 |
// CHECK-GFX1200-SAME: ptr addrspace(1) noundef writeonly captures(none) initializes((0, 16)) [[OUT:%.*]], <4 x half> noundef [[A:%.*]], <4 x half> noundef [[B:%.*]], <4 x float> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR0:[0-9]+]] { |
| 18 |
// CHECK-GFX1200-NEXT: [[ENTRY:.*:]] |
| 19 |
// CHECK-GFX1200-NEXT: [[TMP0:%.*]] = tail call <4 x float> @llvm.amdgcn.wmma.f32.16x16x16.f16.v4f32.v4f16(<4 x half> [[A]], <4 x half> [[B]], <4 x float> [[C]]) |
| 20 |
// CHECK-GFX1200-NEXT: store <4 x float> [[TMP0]], ptr addrspace(1) [[OUT]], align 16, !tbaa [[CHAR_TBAA8:![0-9]+]] |
| 21 |
// CHECK-GFX1200-NEXT: ret void |
| 22 |
// |
| 23 |
void test_amdgcn_wmma_f32_16x16x16_f16_w64(global v4f* out, v4h a, v4h b, v4f c) |
| 24 |
{ |
| 25 |
*out = __builtin_amdgcn_wmma_f32_16x16x16_f16_w64_gfx12(a, b, c); |
| 26 |
} |
| 27 |
|
| 28 |
// |
| 29 |
// amdgcn_wmma_f32_16x16x16_bf16 |
| 30 |
// |
| 31 |
|
| 32 |
// CHECK-GFX1200-LABEL: define dso_local void @test_amdgcn_wmma_f32_16x16x16_bf16_w64( |
| 33 |
// CHECK-GFX1200-SAME: ptr addrspace(1) noundef writeonly captures(none) initializes((0, 16)) [[OUT:%.*]], <4 x i16> noundef [[A:%.*]], <4 x i16> noundef [[B:%.*]], <4 x float> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 34 |
// CHECK-GFX1200-NEXT: [[ENTRY:.*:]] |
| 35 |
// CHECK-GFX1200-NEXT: [[TMP0:%.*]] = tail call <4 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf16.v4f32.v4i16(<4 x i16> [[A]], <4 x i16> [[B]], <4 x float> [[C]]) |
| 36 |
// CHECK-GFX1200-NEXT: store <4 x float> [[TMP0]], ptr addrspace(1) [[OUT]], align 16, !tbaa [[CHAR_TBAA8]] |
| 37 |
// CHECK-GFX1200-NEXT: ret void |
| 38 |
// |
| 39 |
void test_amdgcn_wmma_f32_16x16x16_bf16_w64(global v4f* out, v4s a, v4s b, v4f c) |
| 40 |
{ |
| 41 |
*out = __builtin_amdgcn_wmma_f32_16x16x16_bf16_w64_gfx12(a, b, c); |
| 42 |
} |
| 43 |
|
| 44 |
// |
| 45 |
// amdgcn_wmma_f16_16x16x16_f16 |
| 46 |
// |
| 47 |
|
| 48 |
// CHECK-GFX1200-LABEL: define dso_local void @test_amdgcn_wmma_f16_16x16x16_f16_w64( |
| 49 |
// CHECK-GFX1200-SAME: ptr addrspace(1) noundef writeonly captures(none) initializes((0, 8)) [[OUT:%.*]], <4 x half> noundef [[A:%.*]], <4 x half> noundef [[B:%.*]], <4 x half> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 50 |
// CHECK-GFX1200-NEXT: [[ENTRY:.*:]] |
| 51 |
// CHECK-GFX1200-NEXT: [[TMP0:%.*]] = tail call <4 x half> @llvm.amdgcn.wmma.f16.16x16x16.f16.v4f16.v4f16(<4 x half> [[A]], <4 x half> [[B]], <4 x half> [[C]], i1 false) |
| 52 |
// CHECK-GFX1200-NEXT: store <4 x half> [[TMP0]], ptr addrspace(1) [[OUT]], align 8, !tbaa [[CHAR_TBAA8]] |
| 53 |
// CHECK-GFX1200-NEXT: ret void |
| 54 |
// |
| 55 |
void test_amdgcn_wmma_f16_16x16x16_f16_w64(global v4h* out, v4h a, v4h b, v4h c) |
| 56 |
{ |
| 57 |
*out = __builtin_amdgcn_wmma_f16_16x16x16_f16_w64_gfx12(a, b, c); |
| 58 |
} |
| 59 |
|
| 60 |
// |
| 61 |
// amdgcn_wmma_bf16_16x16x16_bf16 |
| 62 |
// |
| 63 |
|
| 64 |
// CHECK-GFX1200-LABEL: define dso_local void @test_amdgcn_wmma_bf16_16x16x16_bf16_w64( |
| 65 |
// CHECK-GFX1200-SAME: ptr addrspace(1) noundef writeonly captures(none) initializes((0, 8)) [[OUT:%.*]], <4 x i16> noundef [[A:%.*]], <4 x i16> noundef [[B:%.*]], <4 x i16> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 66 |
// CHECK-GFX1200-NEXT: [[ENTRY:.*:]] |
| 67 |
// CHECK-GFX1200-NEXT: [[TMP0:%.*]] = tail call <4 x i16> @llvm.amdgcn.wmma.bf16.16x16x16.bf16.v4i16.v4i16(<4 x i16> [[A]], <4 x i16> [[B]], <4 x i16> [[C]], i1 false) |
| 68 |
// CHECK-GFX1200-NEXT: store <4 x i16> [[TMP0]], ptr addrspace(1) [[OUT]], align 8, !tbaa [[CHAR_TBAA8]] |
| 69 |
// CHECK-GFX1200-NEXT: ret void |
| 70 |
// |
| 71 |
void test_amdgcn_wmma_bf16_16x16x16_bf16_w64(global v4s* out, v4s a, v4s b, v4s c) |
| 72 |
{ |
| 73 |
*out = __builtin_amdgcn_wmma_bf16_16x16x16_bf16_w64_gfx12(a, b, c); |
| 74 |
} |
| 75 |
|
| 76 |
// |
| 77 |
// amdgcn_wmma_i32_16x16x16_iu8 |
| 78 |
// |
| 79 |
|
| 80 |
// CHECK-GFX1200-LABEL: define dso_local void @test_amdgcn_wmma_i32_16x16x16_iu8_w64( |
| 81 |
// CHECK-GFX1200-SAME: ptr addrspace(1) noundef writeonly captures(none) initializes((0, 16)) [[OUT:%.*]], i32 noundef [[A:%.*]], i32 noundef [[B:%.*]], <4 x i32> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 82 |
// CHECK-GFX1200-NEXT: [[ENTRY:.*:]] |
| 83 |
// CHECK-GFX1200-NEXT: [[TMP0:%.*]] = tail call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu8.v4i32.i32(i1 true, i32 [[A]], i1 true, i32 [[B]], <4 x i32> [[C]], i1 false) |
| 84 |
// CHECK-GFX1200-NEXT: store <4 x i32> [[TMP0]], ptr addrspace(1) [[OUT]], align 16, !tbaa [[CHAR_TBAA8]] |
| 85 |
// CHECK-GFX1200-NEXT: ret void |
| 86 |
// |
| 87 |
void test_amdgcn_wmma_i32_16x16x16_iu8_w64(global v4i* out, int a, int b, v4i c) |
| 88 |
{ |
| 89 |
*out = __builtin_amdgcn_wmma_i32_16x16x16_iu8_w64_gfx12(true, a, true, b, c, false); |
| 90 |
} |
| 91 |
|
| 92 |
// |
| 93 |
// amdgcn_wmma_i32_16x16x16_iu4 |
| 94 |
// |
| 95 |
|
| 96 |
// CHECK-GFX1200-LABEL: define dso_local void @test_amdgcn_wmma_i32_16x16x16_iu4_w64( |
| 97 |
// CHECK-GFX1200-SAME: ptr addrspace(1) noundef writeonly captures(none) initializes((0, 16)) [[OUT:%.*]], i32 noundef [[A:%.*]], i32 noundef [[B:%.*]], <4 x i32> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 98 |
// CHECK-GFX1200-NEXT: [[ENTRY:.*:]] |
| 99 |
// CHECK-GFX1200-NEXT: [[TMP0:%.*]] = tail call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x16.iu4.v4i32.i32(i1 true, i32 [[A]], i1 true, i32 [[B]], <4 x i32> [[C]], i1 false) |
| 100 |
// CHECK-GFX1200-NEXT: store <4 x i32> [[TMP0]], ptr addrspace(1) [[OUT]], align 16, !tbaa [[CHAR_TBAA8]] |
| 101 |
// CHECK-GFX1200-NEXT: ret void |
| 102 |
// |
| 103 |
void test_amdgcn_wmma_i32_16x16x16_iu4_w64(global v4i* out, int a, int b, v4i c) |
| 104 |
{ |
| 105 |
*out = __builtin_amdgcn_wmma_i32_16x16x16_iu4_w64_gfx12(true, a, true, b, c, false); |
| 106 |
} |
| 107 |
|
| 108 |
// CHECK-GFX1200-LABEL: define dso_local void @test_amdgcn_wmma_f32_16x16x16_fp8_fp8_w32( |
| 109 |
// CHECK-GFX1200-SAME: ptr addrspace(1) noundef writeonly captures(none) initializes((0, 16)) [[OUT:%.*]], i32 noundef [[A:%.*]], i32 noundef [[B:%.*]], <4 x float> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 110 |
// CHECK-GFX1200-NEXT: [[ENTRY:.*:]] |
| 111 |
// CHECK-GFX1200-NEXT: [[TMP0:%.*]] = tail call <4 x float> @llvm.amdgcn.wmma.f32.16x16x16.fp8.fp8.v4f32.i32(i32 [[A]], i32 [[B]], <4 x float> [[C]]) |
| 112 |
// CHECK-GFX1200-NEXT: store <4 x float> [[TMP0]], ptr addrspace(1) [[OUT]], align 16, !tbaa [[CHAR_TBAA8]] |
| 113 |
// CHECK-GFX1200-NEXT: ret void |
| 114 |
// |
| 115 |
void test_amdgcn_wmma_f32_16x16x16_fp8_fp8_w32(global v4f* out, int a, int b, v4f c) |
| 116 |
{ |
| 117 |
*out = __builtin_amdgcn_wmma_f32_16x16x16_fp8_fp8_w64_gfx12(a, b, c); |
| 118 |
} |
| 119 |
|
| 120 |
// CHECK-GFX1200-LABEL: define dso_local void @test_amdgcn_wmma_f32_16x16x16_fp8_bf8_w32( |
| 121 |
// CHECK-GFX1200-SAME: ptr addrspace(1) noundef writeonly captures(none) initializes((0, 16)) [[OUT:%.*]], i32 noundef [[A:%.*]], i32 noundef [[B:%.*]], <4 x float> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 122 |
// CHECK-GFX1200-NEXT: [[ENTRY:.*:]] |
| 123 |
// CHECK-GFX1200-NEXT: [[TMP0:%.*]] = tail call <4 x float> @llvm.amdgcn.wmma.f32.16x16x16.fp8.bf8.v4f32.i32(i32 [[A]], i32 [[B]], <4 x float> [[C]]) |
| 124 |
// CHECK-GFX1200-NEXT: store <4 x float> [[TMP0]], ptr addrspace(1) [[OUT]], align 16, !tbaa [[CHAR_TBAA8]] |
| 125 |
// CHECK-GFX1200-NEXT: ret void |
| 126 |
// |
| 127 |
void test_amdgcn_wmma_f32_16x16x16_fp8_bf8_w32(global v4f* out, int a, int b, v4f c) |
| 128 |
{ |
| 129 |
*out = __builtin_amdgcn_wmma_f32_16x16x16_fp8_bf8_w64_gfx12(a, b, c); |
| 130 |
} |
| 131 |
|
| 132 |
// CHECK-GFX1200-LABEL: define dso_local void @test_amdgcn_wmma_f32_16x16x16_bf8_fp8_w32( |
| 133 |
// CHECK-GFX1200-SAME: ptr addrspace(1) noundef writeonly captures(none) initializes((0, 16)) [[OUT:%.*]], i32 noundef [[A:%.*]], i32 noundef [[B:%.*]], <4 x float> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 134 |
// CHECK-GFX1200-NEXT: [[ENTRY:.*:]] |
| 135 |
// CHECK-GFX1200-NEXT: [[TMP0:%.*]] = tail call <4 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf8.fp8.v4f32.i32(i32 [[A]], i32 [[B]], <4 x float> [[C]]) |
| 136 |
// CHECK-GFX1200-NEXT: store <4 x float> [[TMP0]], ptr addrspace(1) [[OUT]], align 16, !tbaa [[CHAR_TBAA8]] |
| 137 |
// CHECK-GFX1200-NEXT: ret void |
| 138 |
// |
| 139 |
void test_amdgcn_wmma_f32_16x16x16_bf8_fp8_w32(global v4f* out, int a, int b, v4f c) |
| 140 |
{ |
| 141 |
*out = __builtin_amdgcn_wmma_f32_16x16x16_bf8_fp8_w64_gfx12(a, b, c); |
| 142 |
} |
| 143 |
|
| 144 |
// CHECK-GFX1200-LABEL: define dso_local void @test_amdgcn_wmma_f32_16x16x16_bf8_bf8_w32( |
| 145 |
// CHECK-GFX1200-SAME: ptr addrspace(1) noundef writeonly captures(none) initializes((0, 16)) [[OUT:%.*]], i32 noundef [[A:%.*]], i32 noundef [[B:%.*]], <4 x float> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 146 |
// CHECK-GFX1200-NEXT: [[ENTRY:.*:]] |
| 147 |
// CHECK-GFX1200-NEXT: [[TMP0:%.*]] = tail call <4 x float> @llvm.amdgcn.wmma.f32.16x16x16.bf8.bf8.v4f32.i32(i32 [[A]], i32 [[B]], <4 x float> [[C]]) |
| 148 |
// CHECK-GFX1200-NEXT: store <4 x float> [[TMP0]], ptr addrspace(1) [[OUT]], align 16, !tbaa [[CHAR_TBAA8]] |
| 149 |
// CHECK-GFX1200-NEXT: ret void |
| 150 |
// |
| 151 |
void test_amdgcn_wmma_f32_16x16x16_bf8_bf8_w32(global v4f* out, int a, int b, v4f c) |
| 152 |
{ |
| 153 |
*out = __builtin_amdgcn_wmma_f32_16x16x16_bf8_bf8_w64_gfx12(a, b, c); |
| 154 |
} |
| 155 |
|
| 156 |
// CHECK-GFX1200-LABEL: define dso_local void @test_amdgcn_wmma_i32_16x16x32_iu4_w32( |
| 157 |
// CHECK-GFX1200-SAME: ptr addrspace(1) noundef writeonly captures(none) initializes((0, 16)) [[OUT:%.*]], i32 noundef [[A:%.*]], i32 noundef [[B:%.*]], <4 x i32> noundef [[C:%.*]]) local_unnamed_addr #[[ATTR0]] { |
| 158 |
// CHECK-GFX1200-NEXT: [[ENTRY:.*:]] |
| 159 |
// CHECK-GFX1200-NEXT: [[TMP0:%.*]] = tail call <4 x i32> @llvm.amdgcn.wmma.i32.16x16x32.iu4.v4i32.i32(i1 true, i32 [[A]], i1 true, i32 [[B]], <4 x i32> [[C]], i1 false) |
| 160 |
// CHECK-GFX1200-NEXT: store <4 x i32> [[TMP0]], ptr addrspace(1) [[OUT]], align 16, !tbaa [[CHAR_TBAA8]] |
| 161 |
// CHECK-GFX1200-NEXT: ret void |
| 162 |
// |
| 163 |
void test_amdgcn_wmma_i32_16x16x32_iu4_w32(global v4i* out, int a, int b, v4i c) |
| 164 |
{ |
| 165 |
*out = __builtin_amdgcn_wmma_i32_16x16x32_iu4_w64_gfx12(true, a, true, b, c, false); |
| 166 |
} |
| 167 |
//. |
| 168 |
// CHECK-GFX1200: [[META6:![0-9]+]] = !{!"omnipotent char", [[META7:![0-9]+]], i64 0} |
| 169 |
// CHECK-GFX1200: [[META7]] = !{!"Simple C/C++ TBAA"} |
| 170 |
// CHECK-GFX1200: [[CHAR_TBAA8]] = !{[[META6]], [[META6]], i64 0} |
| 171 |
//. |