[PATCH] D77390: Fix __builtin_amdgcn_workgroup_size_x/y/z return type
Yaxun Liu via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Fri Apr 3 06:57:23 PDT 2020
yaxunl created this revision.
yaxunl added reviewers: b-sumner, arsenm.
Herald added subscribers: kerbowa, nhaehnle, wdng, jvesely.
arsenm accepted this revision.
This revision is now accepted and ready to land.
https://reviews.llvm.org/D77390
Files:
clang/include/clang/Basic/BuiltinsAMDGPU.def
clang/test/CodeGenOpenCL/builtins-amdgcn.cl
Index: clang/test/CodeGenOpenCL/builtins-amdgcn.cl
===================================================================
--- clang/test/CodeGenOpenCL/builtins-amdgcn.cl
+++ clang/test/CodeGenOpenCL/builtins-amdgcn.cl
@@ -538,7 +538,7 @@
void test_get_workgroup_size(int d, global int *out)
{
switch (d) {
- case 0: *out = __builtin_amdgcn_workgroup_size_x(); break;
+ case 0: *out = __builtin_amdgcn_workgroup_size_x() + 1; break;
case 1: *out = __builtin_amdgcn_workgroup_size_y(); break;
case 2: *out = __builtin_amdgcn_workgroup_size_z(); break;
default: *out = 0;
Index: clang/include/clang/Basic/BuiltinsAMDGPU.def
===================================================================
--- clang/include/clang/Basic/BuiltinsAMDGPU.def
+++ clang/include/clang/Basic/BuiltinsAMDGPU.def
@@ -33,9 +33,9 @@
BUILTIN(__builtin_amdgcn_workitem_id_y, "Ui", "nc")
BUILTIN(__builtin_amdgcn_workitem_id_z, "Ui", "nc")
-BUILTIN(__builtin_amdgcn_workgroup_size_x, "Ui", "nc")
-BUILTIN(__builtin_amdgcn_workgroup_size_y, "Ui", "nc")
-BUILTIN(__builtin_amdgcn_workgroup_size_z, "Ui", "nc")
+BUILTIN(__builtin_amdgcn_workgroup_size_x, "Us", "nc")
+BUILTIN(__builtin_amdgcn_workgroup_size_y, "Us", "nc")
+BUILTIN(__builtin_amdgcn_workgroup_size_z, "Us", "nc")
BUILTIN(__builtin_amdgcn_mbcnt_hi, "UiUiUi", "nc")
BUILTIN(__builtin_amdgcn_mbcnt_lo, "UiUiUi", "nc")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D77390.254774.patch
Type: text/x-patch
Size: 1362 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200403/e02d9cf6/attachment.bin>
More information about the cfe-commits
mailing list