[libclc] r279644 - amdgcn: Fix return type for get_global_size

Matt Arsenault via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 24 10:52:05 PDT 2016


Author: arsenm
Date: Wed Aug 24 12:52:04 2016
New Revision: 279644

URL: http://llvm.org/viewvc/llvm-project?rev=279644&view=rev
Log:
amdgcn: Fix return type for get_global_size

Added:
    libclc/trunk/amdgcn/lib/workitem/get_global_size.ll
    libclc/trunk/r600/lib/workitem/get_global_size.ll
      - copied, changed from r279359, libclc/trunk/amdgpu/lib/workitem/get_global_size.ll
Removed:
    libclc/trunk/amdgpu/lib/workitem/get_global_size.ll
Modified:
    libclc/trunk/amdgcn/lib/SOURCES
    libclc/trunk/amdgpu/lib/SOURCES
    libclc/trunk/r600/lib/SOURCES

Modified: libclc/trunk/amdgcn/lib/SOURCES
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/SOURCES?rev=279644&r1=279643&r2=279644&view=diff
==============================================================================
--- libclc/trunk/amdgcn/lib/SOURCES (original)
+++ libclc/trunk/amdgcn/lib/SOURCES Wed Aug 24 12:52:04 2016
@@ -2,6 +2,7 @@ math/ldexp.cl
 synchronization/barrier_impl.ll
 workitem/get_global_offset.cl
 workitem/get_group_id.cl
+workitem/get_global_size.ll
 workitem/get_local_id.cl
 workitem/get_local_size.ll
 workitem/get_work_dim.cl

Added: libclc/trunk/amdgcn/lib/workitem/get_global_size.ll
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/workitem/get_global_size.ll?rev=279644&view=auto
==============================================================================
--- libclc/trunk/amdgcn/lib/workitem/get_global_size.ll (added)
+++ libclc/trunk/amdgcn/lib/workitem/get_global_size.ll Wed Aug 24 12:52:04 2016
@@ -0,0 +1,21 @@
+declare i32 @llvm.r600.read.global.size.x() nounwind readnone
+declare i32 @llvm.r600.read.global.size.y() nounwind readnone
+declare i32 @llvm.r600.read.global.size.z() nounwind readnone
+
+define i64 @get_global_size(i32 %dim) nounwind readnone alwaysinline {
+  switch i32 %dim, label %default [i32 0, label %x_dim i32 1, label %y_dim i32 2, label %z_dim]
+x_dim:
+  %x = call i32 @llvm.r600.read.global.size.x()
+  %x.ext = zext i32 %x to i64
+  ret i64 %x.ext
+y_dim:
+  %y = call i32 @llvm.r600.read.global.size.y()
+  %y.ext = zext i32 %y to i64
+  ret i64 %y.ext
+z_dim:
+  %z = call i32 @llvm.r600.read.global.size.z()
+  %z.ext = zext i32 %z to i64
+  ret i64 %z.ext
+default:
+  ret i64 1
+}

Modified: libclc/trunk/amdgpu/lib/SOURCES
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgpu/lib/SOURCES?rev=279644&r1=279643&r2=279644&view=diff
==============================================================================
--- libclc/trunk/amdgpu/lib/SOURCES (original)
+++ libclc/trunk/amdgpu/lib/SOURCES Wed Aug 24 12:52:04 2016
@@ -17,4 +17,3 @@ image/write_imagei.cl
 image/write_imageui.cl
 image/write_image_impl.ll
 workitem/get_num_groups.ll
-workitem/get_global_size.ll

Removed: libclc/trunk/amdgpu/lib/workitem/get_global_size.ll
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgpu/lib/workitem/get_global_size.ll?rev=279643&view=auto
==============================================================================
--- libclc/trunk/amdgpu/lib/workitem/get_global_size.ll (original)
+++ libclc/trunk/amdgpu/lib/workitem/get_global_size.ll (removed)
@@ -1,18 +0,0 @@
-declare i32 @llvm.r600.read.global.size.x() nounwind readnone
-declare i32 @llvm.r600.read.global.size.y() nounwind readnone
-declare i32 @llvm.r600.read.global.size.z() nounwind readnone
-
-define i32 @get_global_size(i32 %dim) nounwind readnone alwaysinline {
-  switch i32 %dim, label %default [i32 0, label %x_dim i32 1, label %y_dim i32 2, label %z_dim]
-x_dim:
-  %x = call i32 @llvm.r600.read.global.size.x() nounwind readnone
-  ret i32 %x
-y_dim:
-  %y = call i32 @llvm.r600.read.global.size.y() nounwind readnone
-  ret i32 %y
-z_dim:
-  %z = call i32 @llvm.r600.read.global.size.z() nounwind readnone
-  ret i32 %z
-default:
-  ret i32 0
-}

Modified: libclc/trunk/r600/lib/SOURCES
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/SOURCES?rev=279644&r1=279643&r2=279644&view=diff
==============================================================================
--- libclc/trunk/r600/lib/SOURCES (original)
+++ libclc/trunk/r600/lib/SOURCES Wed Aug 24 12:52:04 2016
@@ -1,6 +1,7 @@
 synchronization/barrier_impl.ll
 workitem/get_global_offset.cl
 workitem/get_group_id.cl
+workitem/get_global_size.ll
 workitem/get_local_id.cl
 workitem/get_local_size.ll
 workitem/get_work_dim.cl

Copied: libclc/trunk/r600/lib/workitem/get_global_size.ll (from r279359, libclc/trunk/amdgpu/lib/workitem/get_global_size.ll)
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/workitem/get_global_size.ll?p2=libclc/trunk/r600/lib/workitem/get_global_size.ll&p1=libclc/trunk/amdgpu/lib/workitem/get_global_size.ll&r1=279359&r2=279644&rev=279644&view=diff
==============================================================================
--- libclc/trunk/amdgpu/lib/workitem/get_global_size.ll (original)
+++ libclc/trunk/r600/lib/workitem/get_global_size.ll Wed Aug 24 12:52:04 2016
@@ -14,5 +14,5 @@ z_dim:
   %z = call i32 @llvm.r600.read.global.size.z() nounwind readnone
   ret i32 %z
 default:
-  ret i32 0
+  ret i32 1
 }




More information about the cfe-commits mailing list