diff --git a/llvm/lib/Target/AMDGPU/AMDGPUSearchableTables.td b/llvm/lib/Target/AMDGPU/AMDGPUSearchableTables.td index 7be18998ff6b0..2393346839707 100644 --- a/llvm/lib/Target/AMDGPU/AMDGPUSearchableTables.td +++ b/llvm/lib/Target/AMDGPU/AMDGPUSearchableTables.td @@ -398,6 +398,14 @@ def : AlwaysUniform; def : AlwaysUniform; def : AlwaysUniform; def : AlwaysUniform; +def : AlwaysUniform; +def : AlwaysUniform; +def : AlwaysUniform; +def : AlwaysUniform; +def : AlwaysUniform; +def : AlwaysUniform; +def : AlwaysUniform; +def : AlwaysUniform; def : AlwaysUniform; def : AlwaysUniform; def : AlwaysUniform; diff --git a/llvm/test/Analysis/UniformityAnalysis/AMDGPU/always_uniform.ll b/llvm/test/Analysis/UniformityAnalysis/AMDGPU/always_uniform.ll index 99d9e28425107..9ff670bee0f89 100644 --- a/llvm/test/Analysis/UniformityAnalysis/AMDGPU/always_uniform.ll +++ b/llvm/test/Analysis/UniformityAnalysis/AMDGPU/always_uniform.ll @@ -119,6 +119,70 @@ define void @s_getreg(ptr addrspace(1) inreg %out) { ret void } +; CHECK-LABEL: for function 'cluster_workgroup_id_x': +; CHECK: ALL VALUES UNIFORM +define void @cluster_workgroup_id_x(ptr addrspace(1) inreg %out) { + %result = call i32 @llvm.amdgcn.cluster.workgroup.id.x() + store i32 %result, ptr addrspace(1) %out, align 4 + ret void +} + +; CHECK-LABEL: for function 'cluster_workgroup_id_y': +; CHECK: ALL VALUES UNIFORM +define void @cluster_workgroup_id_y(ptr addrspace(1) inreg %out) { + %result = call i32 @llvm.amdgcn.cluster.workgroup.id.y() + store i32 %result, ptr addrspace(1) %out, align 4 + ret void +} + +; CHECK-LABEL: for function 'cluster_workgroup_id_z': +; CHECK: ALL VALUES UNIFORM +define void @cluster_workgroup_id_z(ptr addrspace(1) inreg %out) { + %result = call i32 @llvm.amdgcn.cluster.workgroup.id.z() + store i32 %result, ptr addrspace(1) %out, align 4 + ret void +} + +; CHECK-LABEL: for function 'cluster_workgroup_flat_id': +; CHECK: ALL VALUES UNIFORM +define void @cluster_workgroup_flat_id(ptr addrspace(1) inreg %out) { + %result = call i32 @llvm.amdgcn.cluster.workgroup.flat.id() + store i32 %result, ptr addrspace(1) %out, align 4 + ret void +} + +; CHECK-LABEL: for function 'cluster_workgroup_max_id_x': +; CHECK: ALL VALUES UNIFORM +define void @cluster_workgroup_max_id_x(ptr addrspace(1) inreg %out) { + %result = call i32 @llvm.amdgcn.cluster.workgroup.max.id.x() + store i32 %result, ptr addrspace(1) %out, align 4 + ret void +} + +; CHECK-LABEL: for function 'cluster_workgroup_max_id_y': +; CHECK: ALL VALUES UNIFORM +define void @cluster_workgroup_max_id_y(ptr addrspace(1) inreg %out) { + %result = call i32 @llvm.amdgcn.cluster.workgroup.max.id.y() + store i32 %result, ptr addrspace(1) %out, align 4 + ret void +} + +; CHECK-LABEL: for function 'cluster_workgroup_max_id_z': +; CHECK: ALL VALUES UNIFORM +define void @cluster_workgroup_max_id_z(ptr addrspace(1) inreg %out) { + %result = call i32 @llvm.amdgcn.cluster.workgroup.max.id.z() + store i32 %result, ptr addrspace(1) %out, align 4 + ret void +} + +; CHECK-LABEL: for function 'cluster_workgroup_max_flat_id': +; CHECK: ALL VALUES UNIFORM +define void @cluster_workgroup_max_flat_id(ptr addrspace(1) inreg %out) { + %result = call i32 @llvm.amdgcn.cluster.workgroup.max.flat.id() + store i32 %result, ptr addrspace(1) %out, align 4 + ret void +} + ; CHECK-LABEL: for function 's_memtime': ; CHECK: ALL VALUES UNIFORM define void @s_memtime(ptr addrspace(1) inreg %out) { @@ -144,6 +208,14 @@ declare i64 @llvm.amdgcn.ballot.i32(i1) #1 declare i32 @llvm.amdgcn.workgroup.id.x() #0 declare i32 @llvm.amdgcn.workgroup.id.y() #0 declare i32 @llvm.amdgcn.workgroup.id.z() #0 +declare i32 @llvm.amdgcn.cluster.workgroup.id.x() +declare i32 @llvm.amdgcn.cluster.workgroup.id.y() +declare i32 @llvm.amdgcn.cluster.workgroup.id.z() +declare i32 @llvm.amdgcn.cluster.workgroup.flat.id() +declare i32 @llvm.amdgcn.cluster.workgroup.max.id.x() +declare i32 @llvm.amdgcn.cluster.workgroup.max.id.y() +declare i32 @llvm.amdgcn.cluster.workgroup.max.id.z() +declare i32 @llvm.amdgcn.cluster.workgroup.max.flat.id() attributes #0 = { nounwind readnone } attributes #1 = { nounwind readnone convergent }