[PATCH] D107769: [OpenCL] Make generic addrspace optional for -fdeclare-opencl-builtins
Sven van Haastregt via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Mon Aug 9 08:55:25 PDT 2021
svenvh created this revision.
svenvh added reviewers: Anastasia, airlied, azabaznov.
svenvh added a project: clang.
Herald added subscribers: ldrumm, yaxunl.
svenvh requested review of this revision.
Herald added a subscriber: cfe-commits.
Currently, -fdeclare-opencl-builtins always adds the generic address
space overloads of e.g. the vload builtin functions in OpenCL 3.0
mode, even when the generic address space feature is disabled.
Guard the generic address space overloads by the
`__opencl_c_generic_address_space` feature instead of by OpenCL
version.
Add a new field `RequireDisabledExtension` to the `Builtin` class so
that we can make certain builtins available only when an extension is
disabled. Thus, we can provide generic address space overloads OR
private/global/local address space overloads depending on the generic
address space feature availability.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D107769
Files:
clang/lib/Sema/OpenCLBuiltins.td
clang/lib/Sema/SemaLookup.cpp
clang/test/CodeGenOpenCL/fdeclare-opencl-builtins.cl
clang/test/SemaOpenCL/fdeclare-opencl-builtins.cl
clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D107769.365197.patch
Type: text/x-patch
Size: 9899 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20210809/69fc39c1/attachment.bin>
More information about the cfe-commits
mailing list