[OpenCL] Align subgroup builtin guards
authorSven van Haastregt <sven.vanhaastregt@arm.com>
Wed, 23 Feb 2022 12:22:09 +0000 (12:22 +0000)
committerSven van Haastregt <sven.vanhaastregt@arm.com>
Wed, 23 Feb 2022 12:22:09 +0000 (12:22 +0000)
commitaa9c2d19d9b73589d72114d6e0a4fb4ce42b922b
treee21592b8f38c038764b2af6620c073a0d2f71c30
parent5fb65557e36ab92d7b38606f7dffd1a3d73a2344
[OpenCL] Align subgroup builtin guards

Until now, subgroup builtins are available with `opencl-c.h` when at
least one of `cl_intel_subgroups`, `cl_khr_subgroups`, or
`__opencl_c_subgroups` is defined.  With `-fdeclare-opencl-builtins`,
subgroup builtins are conditionalized on `cl_khr_subgroups` only.

Align `-fdeclare-opencl-builtins` to `opencl-c.h` by introducing the
internal `__opencl_subgroup_builtins` macro.

Differential Revision: https://reviews.llvm.org/D120254
clang/lib/Headers/opencl-c-base.h
clang/lib/Headers/opencl-c.h
clang/lib/Sema/OpenCLBuiltins.td
clang/test/SemaOpenCL/fdeclare-opencl-builtins.cl