This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Add missing C++ legacy atomics with generic
ClosedPublic

Authored by svenvh on Apr 21 2021, 2:31 AM.

Details

Summary

https://reviews.llvm.org/D62335 added some C++ for OpenCL specific
builtins to opencl-c.h, but these were not mirrored to the TableGen
builtin functions yet.

The TableGen builtins machinery does not have dedicated version
handling for C++ for OpenCL at the moment: all builtin versioning is
tied to LangOpts.OpenCLVersion (i.e., the OpenCL C version). As a
workaround, to add builtins that are only available in C++ for OpenCL,
we define a function extension guarded by the __cplusplus macro.

Fixes PR50041.

Diff Detail

Event Timeline

svenvh created this revision.Apr 21 2021, 2:31 AM
svenvh requested review of this revision.Apr 21 2021, 2:31 AM
Anastasia accepted this revision.Apr 21 2021, 3:15 AM

LGTM!

I realized that as they haven't been added to the OpenCL 3 yet it means they remain as Clang extension. I am going to document this. We could allow their uses in OpenCL C too as an extension though. There were other requests to make them available in OpenCL C too.

This revision is now accepted and ready to land.Apr 21 2021, 3:15 AM
This revision was landed with ongoing or failed builds.Apr 22 2021, 7:08 AM
This revision was automatically updated to reflect the committed changes.