annotate llvm/test/CodeGen/AMDGPU/llvm.amdgcn.is.private.ll @ 236:c4bab56944e8 llvm-original

LLVM 16
author kono
date Wed, 09 Nov 2022 17:45:10 +0900
parents 1d019706d866
children 1f2b6ac9f198
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
150
anatofuz
parents:
diff changeset
1 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=hawaii -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,CI %s
anatofuz
parents:
diff changeset
2 ; RUN: llc -mtriple=amdgcn-amd-amdhsa -mcpu=gfx900 -verify-machineinstrs < %s | FileCheck -enable-var-scope -check-prefixes=GCN,GFX9 %s
anatofuz
parents:
diff changeset
3
anatofuz
parents:
diff changeset
4 ; GCN-LABEL: {{^}}is_private_vgpr:
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
5 ; GCN-DAG: {{flat|global}}_load_dwordx2 v{{\[[0-9]+}}:[[PTR_HI:[0-9]+]]]
150
anatofuz
parents:
diff changeset
6 ; CI-DAG: s_load_dword [[APERTURE:s[0-9]+]], s[4:5], 0x11
anatofuz
parents:
diff changeset
7 ; GFX9-DAG: s_getreg_b32 [[APERTURE:s[0-9]+]], hwreg(HW_REG_SH_MEM_BASES, 0, 16)
anatofuz
parents:
diff changeset
8 ; GFX9: s_lshl_b32 [[APERTURE]], [[APERTURE]], 16
anatofuz
parents:
diff changeset
9 ; GCN: v_cmp_eq_u32_e32 vcc, [[APERTURE]], v[[PTR_HI]]
anatofuz
parents:
diff changeset
10 ; GCN: v_cndmask_b32_e64 v{{[0-9]+}}, 0, 1, vcc
anatofuz
parents:
diff changeset
11 define amdgpu_kernel void @is_private_vgpr(i8* addrspace(1)* %ptr.ptr) {
anatofuz
parents:
diff changeset
12 %id = call i32 @llvm.amdgcn.workitem.id.x()
anatofuz
parents:
diff changeset
13 %gep = getelementptr inbounds i8*, i8* addrspace(1)* %ptr.ptr, i32 %id
anatofuz
parents:
diff changeset
14 %ptr = load volatile i8*, i8* addrspace(1)* %gep
anatofuz
parents:
diff changeset
15 %val = call i1 @llvm.amdgcn.is.private(i8* %ptr)
anatofuz
parents:
diff changeset
16 %ext = zext i1 %val to i32
anatofuz
parents:
diff changeset
17 store i32 %ext, i32 addrspace(1)* undef
anatofuz
parents:
diff changeset
18 ret void
anatofuz
parents:
diff changeset
19 }
anatofuz
parents:
diff changeset
20
anatofuz
parents:
diff changeset
21 ; FIXME: setcc (zero_extend (setcc)), 1) not folded out, resulting in
anatofuz
parents:
diff changeset
22 ; select and vcc branch.
anatofuz
parents:
diff changeset
23
anatofuz
parents:
diff changeset
24 ; GCN-LABEL: {{^}}is_private_sgpr:
anatofuz
parents:
diff changeset
25 ; CI-DAG: s_load_dword [[APERTURE:s[0-9]+]], s[4:5], 0x11{{$}}
anatofuz
parents:
diff changeset
26 ; GFX9-DAG: s_getreg_b32 [[APERTURE:s[0-9]+]], hwreg(HW_REG_SH_MEM_BASES, 0, 16)
anatofuz
parents:
diff changeset
27
anatofuz
parents:
diff changeset
28 ; CI-DAG: s_load_dword [[PTR_HI:s[0-9]+]], s[6:7], 0x1{{$}}
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
29 ; GFX9-DAG: s_load_dword [[PTR_HI:s[0-9]+]], s[4:5], 0x4{{$}}
150
anatofuz
parents:
diff changeset
30 ; GFX9: s_lshl_b32 [[APERTURE]], [[APERTURE]], 16
anatofuz
parents:
diff changeset
31
236
c4bab56944e8 LLVM 16
kono
parents: 150
diff changeset
32 ; GCN: s_cmp_eq_u32 [[PTR_HI]], [[APERTURE]]
150
anatofuz
parents:
diff changeset
33 ; GCN: s_cbranch_vccnz
anatofuz
parents:
diff changeset
34 define amdgpu_kernel void @is_private_sgpr(i8* %ptr) {
anatofuz
parents:
diff changeset
35 %val = call i1 @llvm.amdgcn.is.private(i8* %ptr)
anatofuz
parents:
diff changeset
36 br i1 %val, label %bb0, label %bb1
anatofuz
parents:
diff changeset
37
anatofuz
parents:
diff changeset
38 bb0:
anatofuz
parents:
diff changeset
39 store volatile i32 0, i32 addrspace(1)* undef
anatofuz
parents:
diff changeset
40 br label %bb1
anatofuz
parents:
diff changeset
41
anatofuz
parents:
diff changeset
42 bb1:
anatofuz
parents:
diff changeset
43 ret void
anatofuz
parents:
diff changeset
44 }
anatofuz
parents:
diff changeset
45
anatofuz
parents:
diff changeset
46 declare i32 @llvm.amdgcn.workitem.id.x() #0
anatofuz
parents:
diff changeset
47 declare i1 @llvm.amdgcn.is.private(i8* nocapture) #0
anatofuz
parents:
diff changeset
48
anatofuz
parents:
diff changeset
49 attributes #0 = { nounwind readnone speculatable }