1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -global-isel=0 -mtriple=amdgcn -mcpu=gfx1200 -verify-machineinstrs -mattr=+wavefrontsize64 < %s | FileCheck -check-prefix=GFX12 %s
3 ; RUN: llc -global-isel=1 -mtriple=amdgcn -mcpu=gfx1200 -verify-machineinstrs -mattr=+wavefrontsize64 < %s | FileCheck -check-prefix=GFX12 %s
5 declare i32 @llvm.amdgcn.global.load.tr.b64.i32.p1(ptr addrspace(1))
6 declare <4 x i16> @llvm.amdgcn.global.load.tr.b128.v4i16.p1(ptr addrspace(1))
7 declare <4 x half> @llvm.amdgcn.global.load.tr.b128.v4f16.p1(ptr addrspace(1))
8 declare <4 x bfloat> @llvm.amdgcn.global.load.tr.b128.v4bf16.p1(ptr addrspace(1))
10 define amdgpu_kernel void @global_load_tr_b64_i32(ptr addrspace(1) %addr, ptr addrspace(1) %use) {
11 ; GFX12-LABEL: global_load_tr_b64_i32:
12 ; GFX12: ; %bb.0: ; %entry
13 ; GFX12-NEXT: s_load_b128 s[0:3], s[4:5], 0x24
14 ; GFX12-NEXT: v_mov_b32_e32 v0, 0
15 ; GFX12-NEXT: s_wait_kmcnt 0x0
16 ; GFX12-NEXT: global_load_tr_b64 v1, v0, s[0:1] offset:32
17 ; GFX12-NEXT: s_wait_loadcnt 0x0
18 ; GFX12-NEXT: global_store_b32 v0, v1, s[2:3]
19 ; GFX12-NEXT: s_endpgm
21 %gep = getelementptr i64, ptr addrspace(1) %addr, i32 4
22 %val = call i32 @llvm.amdgcn.global.load.tr.b64.i32.p1(ptr addrspace(1) %gep)
23 store i32 %val, ptr addrspace(1) %use
27 define amdgpu_kernel void @global_load_tr_b128_v4i16(ptr addrspace(1) %addr, ptr addrspace(1) %use) {
28 ; GFX12-LABEL: global_load_tr_b128_v4i16:
29 ; GFX12: ; %bb.0: ; %entry
30 ; GFX12-NEXT: s_load_b128 s[0:3], s[4:5], 0x24
31 ; GFX12-NEXT: v_mov_b32_e32 v2, 0
32 ; GFX12-NEXT: s_wait_kmcnt 0x0
33 ; GFX12-NEXT: global_load_tr_b128 v[0:1], v2, s[0:1] offset:32
34 ; GFX12-NEXT: s_wait_loadcnt 0x0
35 ; GFX12-NEXT: global_store_b64 v2, v[0:1], s[2:3]
36 ; GFX12-NEXT: s_endpgm
38 %gep = getelementptr i64, ptr addrspace(1) %addr, i32 4
39 %val = call <4 x i16> @llvm.amdgcn.global.load.tr.b128.v4i16.p1(ptr addrspace(1) %gep)
40 store <4 x i16> %val, ptr addrspace(1) %use
44 define amdgpu_kernel void @global_load_tr_b128_v4f16(ptr addrspace(1) %addr, ptr addrspace(1) %use) {
45 ; GFX12-LABEL: global_load_tr_b128_v4f16:
46 ; GFX12: ; %bb.0: ; %entry
47 ; GFX12-NEXT: s_load_b128 s[0:3], s[4:5], 0x24
48 ; GFX12-NEXT: v_mov_b32_e32 v2, 0
49 ; GFX12-NEXT: s_wait_kmcnt 0x0
50 ; GFX12-NEXT: global_load_tr_b128 v[0:1], v2, s[0:1] offset:32
51 ; GFX12-NEXT: s_wait_loadcnt 0x0
52 ; GFX12-NEXT: global_store_b64 v2, v[0:1], s[2:3]
53 ; GFX12-NEXT: s_endpgm
55 %gep = getelementptr i64, ptr addrspace(1) %addr, i32 4
56 %val = call <4 x half> @llvm.amdgcn.global.load.tr.b128.v4f16.p1(ptr addrspace(1) %gep)
57 store <4 x half> %val, ptr addrspace(1) %use
61 define amdgpu_kernel void @global_load_tr_b128_v4bf16(ptr addrspace(1) %addr, ptr addrspace(1) %use) {
62 ; GFX12-LABEL: global_load_tr_b128_v4bf16:
63 ; GFX12: ; %bb.0: ; %entry
64 ; GFX12-NEXT: s_load_b128 s[0:3], s[4:5], 0x24
65 ; GFX12-NEXT: v_mov_b32_e32 v2, 0
66 ; GFX12-NEXT: s_wait_kmcnt 0x0
67 ; GFX12-NEXT: global_load_tr_b128 v[0:1], v2, s[0:1] offset:32
68 ; GFX12-NEXT: s_wait_loadcnt 0x0
69 ; GFX12-NEXT: global_store_b64 v2, v[0:1], s[2:3]
70 ; GFX12-NEXT: s_endpgm
72 %gep = getelementptr i64, ptr addrspace(1) %addr, i32 4
73 %val = call <4 x bfloat> @llvm.amdgcn.global.load.tr.b128.v4bf16.p1(ptr addrspace(1) %gep)
74 store <4 x bfloat> %val, ptr addrspace(1) %use