[libclc] r279723 - amdgcn: Fix return type of get_num_groups
Matt Arsenault via cfe-commits
cfe-commits at lists.llvm.org
Thu Aug 25 00:31:40 PDT 2016
Author: arsenm
Date: Thu Aug 25 02:31:40 2016
New Revision: 279723
URL: http://llvm.org/viewvc/llvm-project?rev=279723&view=rev
Log:
amdgcn: Fix return type of get_num_groups
Added:
libclc/trunk/amdgcn/lib/workitem/get_num_groups.ll
libclc/trunk/r600/lib/workitem/get_num_groups.ll
- copied, changed from r279692, libclc/trunk/amdgpu/lib/workitem/get_num_groups.ll
Removed:
libclc/trunk/amdgpu/lib/workitem/get_num_groups.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=279723&r1=279722&r2=279723&view=diff
==============================================================================
--- libclc/trunk/amdgcn/lib/SOURCES (original)
+++ libclc/trunk/amdgcn/lib/SOURCES Thu Aug 25 02:31:40 2016
@@ -5,4 +5,5 @@ workitem/get_group_id.cl
workitem/get_global_size.ll
workitem/get_local_id.cl
workitem/get_local_size.ll
+workitem/get_num_groups.ll
workitem/get_work_dim.cl
Added: libclc/trunk/amdgcn/lib/workitem/get_num_groups.ll
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgcn/lib/workitem/get_num_groups.ll?rev=279723&view=auto
==============================================================================
--- libclc/trunk/amdgcn/lib/workitem/get_num_groups.ll (added)
+++ libclc/trunk/amdgcn/lib/workitem/get_num_groups.ll Thu Aug 25 02:31:40 2016
@@ -0,0 +1,21 @@
+declare i32 @llvm.r600.read.ngroups.x() nounwind readnone
+declare i32 @llvm.r600.read.ngroups.y() nounwind readnone
+declare i32 @llvm.r600.read.ngroups.z() nounwind readnone
+
+define i64 @get_num_groups(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.ngroups.x()
+ %x.ext = zext i32 %x to i64
+ ret i64 %x.ext
+y_dim:
+ %y = call i32 @llvm.r600.read.ngroups.y()
+ %y.ext = zext i32 %y to i64
+ ret i64 %y.ext
+z_dim:
+ %z = call i32 @llvm.r600.read.ngroups.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=279723&r1=279722&r2=279723&view=diff
==============================================================================
--- libclc/trunk/amdgpu/lib/SOURCES (original)
+++ libclc/trunk/amdgpu/lib/SOURCES Thu Aug 25 02:31:40 2016
@@ -16,4 +16,3 @@ image/write_imagef.cl
image/write_imagei.cl
image/write_imageui.cl
image/write_image_impl.ll
-workitem/get_num_groups.ll
Removed: libclc/trunk/amdgpu/lib/workitem/get_num_groups.ll
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/amdgpu/lib/workitem/get_num_groups.ll?rev=279722&view=auto
==============================================================================
--- libclc/trunk/amdgpu/lib/workitem/get_num_groups.ll (original)
+++ libclc/trunk/amdgpu/lib/workitem/get_num_groups.ll (removed)
@@ -1,18 +0,0 @@
-declare i32 @llvm.r600.read.ngroups.x() nounwind readnone
-declare i32 @llvm.r600.read.ngroups.y() nounwind readnone
-declare i32 @llvm.r600.read.ngroups.z() nounwind readnone
-
-define i32 @get_num_groups(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.ngroups.x() nounwind readnone
- ret i32 %x
-y_dim:
- %y = call i32 @llvm.r600.read.ngroups.y() nounwind readnone
- ret i32 %y
-z_dim:
- %z = call i32 @llvm.r600.read.ngroups.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=279723&r1=279722&r2=279723&view=diff
==============================================================================
--- libclc/trunk/r600/lib/SOURCES (original)
+++ libclc/trunk/r600/lib/SOURCES Thu Aug 25 02:31:40 2016
@@ -4,4 +4,5 @@ workitem/get_group_id.cl
workitem/get_global_size.ll
workitem/get_local_id.cl
workitem/get_local_size.ll
+workitem/get_num_groups.ll
workitem/get_work_dim.cl
Copied: libclc/trunk/r600/lib/workitem/get_num_groups.ll (from r279692, libclc/trunk/amdgpu/lib/workitem/get_num_groups.ll)
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/r600/lib/workitem/get_num_groups.ll?p2=libclc/trunk/r600/lib/workitem/get_num_groups.ll&p1=libclc/trunk/amdgpu/lib/workitem/get_num_groups.ll&r1=279692&r2=279723&rev=279723&view=diff
==============================================================================
--- libclc/trunk/amdgpu/lib/workitem/get_num_groups.ll (original)
+++ libclc/trunk/r600/lib/workitem/get_num_groups.ll Thu Aug 25 02:31:40 2016
@@ -14,5 +14,5 @@ z_dim:
%z = call i32 @llvm.r600.read.ngroups.z() nounwind readnone
ret i32 %z
default:
- ret i32 0
+ ret i32 1
}
More information about the cfe-commits
mailing list