This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Add support of __opencl_c_pipes feature macro.
ClosedPublic

Authored by azabaznov on Jul 30 2021, 5:31 AM.

Details

Summary

'pipe' keyword is introduced in OpenCL C 2.0: so do checks for OpenCL C version while
parsing and then later on check for language options to construct actual pipe. This feature
requires support of __opencl_c_generic_address_space, so diagnostics for that is provided as well.

This is the same patch as in D106748 but with a tiny fix in checking of diagnostic messages.
Also added tests when program scope global variables are not supported.

Diff Detail

Event Timeline

azabaznov created this revision.Jul 30 2021, 5:31 AM
azabaznov requested review of this revision.Jul 30 2021, 5:31 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 30 2021, 5:31 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
azabaznov updated this revision to Diff 363044.Jul 30 2021, 5:37 AM

Fix doubling run lines, misprint

Anastasia accepted this revision.Jul 30 2021, 6:18 AM

LGTM! Thanks

We might need to fix the target triple in clang/test/SemaOpenCL/invalid-pipes-cl2.0.cl to avoid surprises with testing but it has better coverage if we don't though...

This revision is now accepted and ready to land.Jul 30 2021, 6:18 AM

We might need to fix the target triple in clang/test/SemaOpenCL/invalid-pipes-cl2.0.cl to avoid surprises with testing but it has better coverage if we don't though...

Yeah, I am not sure now though. It's awful because testing is not deterministic as we have different default targets here, but on the other hand it helps to catch errors like this. Maybe it makes sense to change the existing target to spir and also add a random target here, such as nvptx for example?

This revision was automatically updated to reflect the committed changes.