[PATCH] D120254: [OpenCL] Align subgroup builtin guards
Harald van Dijk via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Thu Mar 31 07:26:57 PDT 2022
hvdijk added a comment.
In D120254#3419369 <https://reviews.llvm.org/D120254#3419369>, @svenvh wrote:
> In D120254#3419221 <https://reviews.llvm.org/D120254#3419221>, @hvdijk wrote:
>
>> The problem is that this change enables certain built-ins in OpenCL 1.2 that take a memory_scope argument, but the memory_scope type is not defined in OpenCL 1.2 mode. When we then process the function, sub_group_barrier in my example, things break when checking whether the declaration matches the built-in. I am not sure what the right fix here is. Can we just define the type if any extension is enabled that requires the type, or is that not allowed?
>
> Thanks for digging further and providing a reproducer! I think the fix is to only make the `sub_group_barrier(cl_mem_fence_flags flags, memory_scope)` overload available for OpenCL 2.0 or above. That would also match `opencl-c.h`.
>
> The following patch seems to fix the issue that you described:
Huh, I could have sworn I saw more builtins than just this one but clearly I messed up there, that's the only one. That fix looks good to me, thanks, do you want to submit that as a new change along with the test or would you like a hand with it?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D120254/new/
https://reviews.llvm.org/D120254
More information about the cfe-commits
mailing list