This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] opencl-c.h: refactor named addrspace builtins
ClosedPublic

Authored by svenvh on Jan 25 2022, 9:02 AM.

Details

Reviewers
Anastasia
Group Reviewers
Restricted Project
Commits
rGbfd8210f6f47: [OpenCL] opencl-c.h: refactor named addrspace builtins
Summary

The named address space overloads of builtins that take a pointer
argument are conditionalized on the __opencl_c_generic_address_space
feature macro (in a #else body). Introduce an internal feature
macro instead, such that their availability can be controlled in a
single place and independently of the generic address space feature
macro.

This commit does not change the available builtins.

Diff Detail

Event Timeline

svenvh created this revision.Jan 25 2022, 9:02 AM
svenvh requested review of this revision.Jan 25 2022, 9:02 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 25 2022, 9:02 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
Anastasia accepted this revision.Jan 26 2022, 9:03 AM

LGTM, aside from the name that can be fixed on a final commit!

clang/lib/Headers/opencl-c-base.h
78

I think for consistency it's better to spell addrsp -> address_space as we don't gain much space anyway...

Or maybe we could use __opencl_c_builtins_with_named_address_spaces?

This revision is now accepted and ready to land.Jan 26 2022, 9:03 AM
This revision was landed with ongoing or failed builds.Jan 28 2022, 2:25 AM
This revision was automatically updated to reflect the committed changes.