[libclc] 01/01: Add a patch to fix the functions get_global_size, get_local_size and get_num_groups on amdgcn with LLVM 3.9 (closes: #857591).

Andreas Boll aboll-guest at moszumanska.debian.org
Tue May 9 16:03:49 UTC 2017


This is an automated email from the git hooks/post-receive script.

aboll-guest pushed a commit to branch stretch
in repository libclc.

commit dbcf770a7e254e6e3a52bb7c19ee6d3775a6683a
Author: Andreas Boll <andreas.boll.dev at gmail.com>
Date:   Tue May 9 17:44:26 2017 +0200

    Add a patch to fix the functions get_global_size, get_local_size and get_num_groups on amdgcn with LLVM 3.9 (closes: #857591).
---
 debian/changelog                                   |   8 ++
 .../0001-amdgcn-size_t-is-i32-in-mesa3d.patch      | 105 +++++++++++++++++++++
 debian/patches/series                              |   1 +
 3 files changed, 114 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 36dffbb..a868bef 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,11 @@
+libclc (0.2.0+git20160907-4) UNRELEASED; urgency=medium
+
+  * Team upload.
+  * Add a patch to fix the functions get_global_size, get_local_size and
+    get_num_groups on amdgcn with LLVM 3.9 (closes: #857591).
+
+ -- Andreas Boll <andreas.boll.dev at gmail.com>  Tue, 09 May 2017 17:43:55 +0200
+
 libclc (0.2.0+git20160907-3) unstable; urgency=medium
 
   * Simplify clang version updates.
diff --git a/debian/patches/0001-amdgcn-size_t-is-i32-in-mesa3d.patch b/debian/patches/0001-amdgcn-size_t-is-i32-in-mesa3d.patch
new file mode 100644
index 0000000..73112b4
--- /dev/null
+++ b/debian/patches/0001-amdgcn-size_t-is-i32-in-mesa3d.patch
@@ -0,0 +1,105 @@
+From b85d3a9c7e496f872b167d5405f052a3f682925b Mon Sep 17 00:00:00 2001
+From: Jan Vesely <jano.vesely at gmail.com>
+Date: Sun, 26 Feb 2017 07:34:19 -0500
+Subject: [PATCH] amdgcn: size_t is i32 in mesa3d
+
+Signed-off-by: Jan Vesely <jano.vesely at gmail.com>
+---
+ amdgcn/lib/workitem/get_global_size.ll | 13 +++++--------
+ amdgcn/lib/workitem/get_local_size.ll  | 13 +++++--------
+ amdgcn/lib/workitem/get_num_groups.ll  | 13 +++++--------
+ 3 files changed, 15 insertions(+), 24 deletions(-)
+
+diff --git a/amdgcn/lib/workitem/get_global_size.ll b/amdgcn/lib/workitem/get_global_size.ll
+index a516255..d51def3 100644
+--- a/amdgcn/lib/workitem/get_global_size.ll
++++ b/amdgcn/lib/workitem/get_global_size.ll
+@@ -2,20 +2,17 @@ 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 {
++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()
+-  %x.ext = zext i32 %x to i64
+-  ret i64 %x.ext
++  ret i32 %x
+ y_dim:
+   %y = call i32 @llvm.r600.read.global.size.y()
+-  %y.ext = zext i32 %y to i64
+-  ret i64 %y.ext
++  ret i32 %y
+ z_dim:
+   %z = call i32 @llvm.r600.read.global.size.z()
+-  %z.ext = zext i32 %z to i64
+-  ret i64 %z.ext
++  ret i32 %z
+ default:
+-  ret i64 1
++  ret i32 1
+ }
+diff --git a/amdgcn/lib/workitem/get_local_size.ll b/amdgcn/lib/workitem/get_local_size.ll
+index a943375..92c6d26 100644
+--- a/amdgcn/lib/workitem/get_local_size.ll
++++ b/amdgcn/lib/workitem/get_local_size.ll
+@@ -2,20 +2,17 @@ declare i32 @llvm.r600.read.local.size.x() nounwind readnone
+ declare i32 @llvm.r600.read.local.size.y() nounwind readnone
+ declare i32 @llvm.r600.read.local.size.z() nounwind readnone
+ 
+-define i64 @get_local_size(i32 %dim) nounwind readnone alwaysinline {
++define i32 @get_local_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.local.size.x()
+-  %x.ext = zext i32 %x to i64
+-  ret i64 %x.ext
++  ret i32 %x
+ y_dim:
+   %y = call i32 @llvm.r600.read.local.size.y()
+-  %y.ext = zext i32 %y to i64
+-  ret i64 %y.ext
++  ret i32 %y
+ z_dim:
+   %z = call i32 @llvm.r600.read.local.size.z()
+-  %z.ext = zext i32 %z to i64
+-  ret i64 %z.ext
++  ret i32 %z
+ default:
+-  ret i64 1
++  ret i32 1
+ }
+diff --git a/amdgcn/lib/workitem/get_num_groups.ll b/amdgcn/lib/workitem/get_num_groups.ll
+index 5b4b1cc..fd5c17c 100644
+--- a/amdgcn/lib/workitem/get_num_groups.ll
++++ b/amdgcn/lib/workitem/get_num_groups.ll
+@@ -2,20 +2,17 @@ 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 {
++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()
+-  %x.ext = zext i32 %x to i64
+-  ret i64 %x.ext
++  ret i32 %x
+ y_dim:
+   %y = call i32 @llvm.r600.read.ngroups.y()
+-  %y.ext = zext i32 %y to i64
+-  ret i64 %y.ext
++  ret i32 %y
+ z_dim:
+   %z = call i32 @llvm.r600.read.ngroups.z()
+-  %z.ext = zext i32 %z to i64
+-  ret i64 %z.ext
++  ret i32 %z
+ default:
+-  ret i64 1
++  ret i32 1
+ }
+-- 
+2.10.2
+
diff --git a/debian/patches/series b/debian/patches/series
index 814900f..a88cdd4 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1 +1,2 @@
 hardening.patch
+0001-amdgcn-size_t-is-i32-in-mesa3d.patch

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-opencl/libclc.git



More information about the Pkg-opencl-commits mailing list