1 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -verify-machineinstrs -stress-regalloc=1 < %s | FileCheck -check-prefix=GCN %s
3 ; GCN-LABEL: {{^}}spill_csr_s5_copy:
4 ; GCN: s_mov_b32 [[FP_SCRATCH_COPY:s[0-9]+]], s33
5 ; GCN: s_xor_saveexec_b64
6 ; GCN-NEXT: buffer_store_dword v0, off, s[0:3], s33 offset:12 ; 4-byte Folded Spill
7 ; GCN-NEXT: s_mov_b64 exec, -1
8 ; GCN-NEXT: buffer_store_dword v40, off, s[0:3], s33 offset:4 ; 4-byte Folded Spill
9 ; GCN-NEXT: s_mov_b64 exec
10 ; GCN: v_writelane_b32 v40, [[FP_SCRATCH_COPY]], 4
13 ; GCN: v_mov_b32_e32 [[K:v[0-9]+]], 9
14 ; GCN: buffer_store_dword [[K]], off, s[0:3], s33{{$}}
16 ; GCN: v_readlane_b32 [[FP_SCRATCH_COPY:s[0-9]+]], v40, 4
17 ; GCN: s_xor_saveexec_b64
18 ; GCN-NEXT: buffer_load_dword v0, off, s[0:3], s33 offset:12 ; 4-byte Folded Reload
19 ; GCN-NEXT: s_mov_b64 exec, -1
20 ; GCN-NEXT: buffer_load_dword v40, off, s[0:3], s33 offset:4 ; 4-byte Folded Reload
22 ; GCN: s_mov_b32 s33, [[FP_SCRATCH_COPY]]
24 define void @spill_csr_s5_copy() #0 {
26 %alloca = alloca i32, addrspace(5)
27 %tmp = tail call i64 @func() #1
28 %tmp1 = getelementptr inbounds i32, ptr addrspace(1) null, i64 %tmp
29 %tmp2 = load i32, ptr addrspace(1) %tmp1, align 4
30 %tmp3 = zext i32 %tmp2 to i64
31 store volatile i32 9, ptr addrspace(5) %alloca
35 declare i64 @func() #0
37 attributes #0 = { nounwind "amdgpu-no-dispatch-id" "amdgpu-no-dispatch-ptr" "amdgpu-no-implicitarg-ptr" "amdgpu-no-queue-ptr" "amdgpu-no-workgroup-id-x" "amdgpu-no-workgroup-id-y" "amdgpu-no-workgroup-id-z" "amdgpu-no-workitem-id-x" "amdgpu-no-workitem-id-y" "amdgpu-no-workitem-id-z" }
38 attributes #1 = { nounwind readnone }