1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 4
2 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 < %s | FileCheck %s --check-prefixes=ASM,DAGISEL-ASM
3 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -global-isel -mcpu=gfx900 < %s | FileCheck %s --check-prefixes=ASM,GISEL-ASM
5 define void @local_to_flat(ptr addrspace(3) %ptr) {
6 ; ASM-LABEL: local_to_flat:
8 ; ASM-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
9 ; ASM-NEXT: s_mov_b64 s[4:5], src_shared_base
10 ; ASM-NEXT: v_mov_b32_e32 v1, s5
11 ; ASM-NEXT: v_mov_b32_e32 v2, 7
12 ; ASM-NEXT: flat_store_dword v[0:1], v2
13 ; ASM-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
14 ; ASM-NEXT: s_setpc_b64 s[30:31]
15 %1 = call ptr @llvm.amdgcn.addrspacecast.nonnull.p0.p3(ptr addrspace(3) %ptr)
16 store volatile i32 7, ptr %1, align 4
20 define void @private_to_flat(ptr addrspace(5) %ptr) {
21 ; ASM-LABEL: private_to_flat:
23 ; ASM-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
24 ; ASM-NEXT: s_mov_b64 s[4:5], src_private_base
25 ; ASM-NEXT: v_mov_b32_e32 v1, s5
26 ; ASM-NEXT: v_mov_b32_e32 v2, 7
27 ; ASM-NEXT: flat_store_dword v[0:1], v2
28 ; ASM-NEXT: s_waitcnt vmcnt(0) lgkmcnt(0)
29 ; ASM-NEXT: s_setpc_b64 s[30:31]
30 %1 = call ptr @llvm.amdgcn.addrspacecast.nonnull.p0.p5(ptr addrspace(5) %ptr)
31 store volatile i32 7, ptr %1, align 4
35 define void @flat_to_local(ptr %ptr) {
36 ; ASM-LABEL: flat_to_local:
38 ; ASM-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
39 ; ASM-NEXT: v_mov_b32_e32 v1, 7
40 ; ASM-NEXT: ds_write_b32 v0, v1
41 ; ASM-NEXT: s_waitcnt lgkmcnt(0)
42 ; ASM-NEXT: s_setpc_b64 s[30:31]
43 %1 = call ptr addrspace(3) @llvm.amdgcn.addrspacecast.nonnull.p3.p0(ptr %ptr)
44 store volatile i32 7, ptr addrspace(3) %1, align 4
48 define void @flat_to_private(ptr %ptr) {
49 ; ASM-LABEL: flat_to_private:
51 ; ASM-NEXT: s_waitcnt vmcnt(0) expcnt(0) lgkmcnt(0)
52 ; ASM-NEXT: v_mov_b32_e32 v1, 7
53 ; ASM-NEXT: buffer_store_dword v1, v0, s[0:3], 0 offen
54 ; ASM-NEXT: s_waitcnt vmcnt(0)
55 ; ASM-NEXT: s_setpc_b64 s[30:31]
56 %1 = call ptr addrspace(5) @llvm.amdgcn.addrspacecast.nonnull.p5.p0(ptr %ptr)
57 store volatile i32 7, ptr addrspace(5) %1, align 4
61 declare ptr @llvm.amdgcn.addrspacecast.nonnull.p0.p3(ptr addrspace(3))
62 declare ptr @llvm.amdgcn.addrspacecast.nonnull.p0.p5(ptr addrspace(5))
63 declare ptr addrspace(3) @llvm.amdgcn.addrspacecast.nonnull.p3.p0(ptr)
64 declare ptr addrspace(5) @llvm.amdgcn.addrspacecast.nonnull.p5.p0(ptr)
66 declare <4 x ptr> @llvm.amdgcn.addrspacecast.nonnull.v4p0.v4p3(<4 x ptr addrspace(3)>)
67 ;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line: