1 ; RUN: llc -march=amdgcn -mcpu=tahiti -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
2 ; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=kaveri -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
3 ; RUN: llc -mtriple=amdgcn--amdhsa -mcpu=fiji -verify-machineinstrs < %s | FileCheck -check-prefix=GCN %s
5 ; GCN-LABEL: {{^}}s_getreg_test:
6 ; GCN: s_getreg_b32 s{{[0-9]+}}, hwreg(HW_REG_LDS_ALLOC, 8, 23)
7 define amdgpu_kernel void @s_getreg_test(i32 addrspace(1)* %out) { ; simm16=45574 for lds size.
8 %lds_size_64dwords = call i32 @llvm.amdgcn.s.getreg(i32 45574)
9 %lds_size_bytes = shl i32 %lds_size_64dwords, 8
10 store i32 %lds_size_bytes, i32 addrspace(1)* %out
14 ; Call site has additional readnone knowledge.
15 ; GCN-LABEL: {{^}}readnone_s_getreg_test:
16 ; GCN: s_getreg_b32 s{{[0-9]+}}, hwreg(HW_REG_LDS_ALLOC, 8, 23)
17 define amdgpu_kernel void @readnone_s_getreg_test(i32 addrspace(1)* %out) { ; simm16=45574 for lds size.
18 %lds_size_64dwords = call i32 @llvm.amdgcn.s.getreg(i32 45574) #1
19 %lds_size_bytes = shl i32 %lds_size_64dwords, 8
20 store i32 %lds_size_bytes, i32 addrspace(1)* %out
24 declare i32 @llvm.amdgcn.s.getreg(i32) #0
26 attributes #0 = { nounwind readonly }
27 attributes #1 = { nounwind readnone }