This is an archive of the discontinued LLVM Phabricator instance.

[OpenCL] Add verbosity when checking support of read_write images
ClosedPublic

Authored by azabaznov on Jul 13 2021, 6:53 AM.

Diff Detail

Event Timeline

azabaznov created this revision.Jul 13 2021, 6:53 AM
azabaznov requested review of this revision.Jul 13 2021, 6:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 13 2021, 6:53 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

This is not NFC, is it? Before, this got evaluated as (!S.getLangOpts().OpenCLCPlusPlus && S.getLangOpts().OpenCLVersion < 200) || (S.getLangOpts().OpenCLVersion == 300 && !S.getOpenCLOptions().isSupported("__opencl_c_read_write_images", S.getLangOpts())). Now, it's evaluated as !S.getLangOpts().OpenCLCPlusPlus && (...rest...) -- that is, !S.getLangOpts().OpenCLCPlusPlus used to be anded with just one term and now it's anded with the whole thing.

Maybe it's worth to introduce some bool variables to make this less confusing instead of this one very long term?

Note: https://reviews.llvm.org/D105890 that was just landed to touch the same area.

FWIW, I agree that this should probably be using some local variables to make the conditions a bit more clear.

azabaznov updated this revision to Diff 358265.Jul 13 2021, 7:48 AM

Add comment for C++ for OpenCL, add variable to check support for OpenCL C

azabaznov retitled this revision from [NFC] Silence build warning by placing parentheses around condition to [OpenCL] Add verbosity when checking support of read_write images.Jul 13 2021, 7:49 AM
azabaznov edited the summary of this revision. (Show Details)
Anastasia accepted this revision.Jul 13 2021, 8:08 AM

LGTM! Thanks!

This revision is now accepted and ready to land.Jul 13 2021, 8:08 AM

Note: https://reviews.llvm.org/D105890 that was just landed to touch the same area.

Yeah, I think it fixed the actual warning but we can still simplify the condition.

This revision was landed with ongoing or failed builds.Jul 13 2021, 8:47 AM
This revision was automatically updated to reflect the committed changes.