r600: Use llvm intrinsic to read work dimension information

v2: Fix function declaration
    Add range metadata to r600 implementation
v3: change prefix to AMDGPU

Reviewed-by: Tom Stellard <tom@stellard.net>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 219793
This commit is contained in:
Jan Vesely 2014-10-15 15:08:06 +00:00
parent 8513d6234d
commit 260827caa2
3 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1 @@
_CLC_DECL uint get_work_dim();

View File

@ -5,5 +5,6 @@ workitem/get_group_id.ll
workitem/get_local_size.ll
workitem/get_local_id.ll
workitem/get_global_size.ll
workitem/get_work_dim.ll
synchronization/barrier.cl
synchronization/barrier_impl.ll

View File

@ -0,0 +1,8 @@
declare i32 @llvm.AMDGPU.read.workdim() nounwind readnone
define i32 @get_work_dim() nounwind readnone alwaysinline {
%x = call i32 @llvm.AMDGPU.read.workdim() nounwind readnone , !range !0
ret i32 %x
}
!0 = metadata !{ i8 1, i8 2, i8 3 }