1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -global-isel -mtriple=amdgcn-amd-amdhsa -mcpu=bonaire -verify-machineinstrs < %s | FileCheck %s
3 ; TODO: Replace with existing DAG tests
5 @lds_512_4 = internal unnamed_addr addrspace(3) global [128 x i32] undef, align 4
6 @lds_4_8 = addrspace(3) global i32 undef, align 8
8 define amdgpu_kernel void @use_lds_globals(ptr addrspace(1) %out, ptr addrspace(3) %in) #0 {
9 ; CHECK-LABEL: use_lds_globals:
10 ; CHECK: ; %bb.0: ; %entry
11 ; CHECK-NEXT: s_load_dwordx2 s[0:1], s[6:7], 0x0
12 ; CHECK-NEXT: v_mov_b32_e32 v0, 4
13 ; CHECK-NEXT: s_mov_b32 m0, -1
14 ; CHECK-NEXT: ds_read_b32 v2, v0
15 ; CHECK-NEXT: v_mov_b32_e32 v3, 9
16 ; CHECK-NEXT: s_waitcnt lgkmcnt(0)
17 ; CHECK-NEXT: s_add_u32 s0, s0, 4
18 ; CHECK-NEXT: s_addc_u32 s1, s1, 0
19 ; CHECK-NEXT: v_mov_b32_e32 v0, s0
20 ; CHECK-NEXT: v_mov_b32_e32 v1, s1
21 ; CHECK-NEXT: flat_store_dword v[0:1], v2
22 ; CHECK-NEXT: v_mov_b32_e32 v0, 0x200
23 ; CHECK-NEXT: ds_write_b32 v0, v3
24 ; CHECK-NEXT: s_endpgm
26 %tmp0 = getelementptr [128 x i32], ptr addrspace(3) @lds_512_4, i32 0, i32 1
27 %tmp1 = load i32, ptr addrspace(3) %tmp0
28 %tmp2 = getelementptr i32, ptr addrspace(1) %out, i32 1
29 store i32 %tmp1, ptr addrspace(1) %tmp2
30 store i32 9, ptr addrspace(3) @lds_4_8
34 attributes #0 = { nounwind }