[PATCH] D103911: [OpenCL] Add support of __opencl_c_images feature macro

2021-06-08 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov created this revision. azabaznov added reviewers: Anastasia, svenvh. Herald added subscribers: ldrumm, yaxunl. azabaznov requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.o

[PATCH] D97869: [OpenCL] Add OpenCL builtin test generator

2021-06-09 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. @svenvh, are you going to add header-like output emitting? CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97869/new/ https://reviews.llvm.org/D97869 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lis

[PATCH] D97869: [OpenCL] Add OpenCL builtin test generator

2021-06-09 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. In D97869#2807654 , @svenvh wrote: > In D97869#2807627 , @azabaznov wrote: > >> @svenvh, are you going to add header-like output emitting? > > Yes, I can add that if there is interest. I

[PATCH] D103911: [OpenCL] Add support of __opencl_c_images feature macro

2021-06-09 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added inline comments. Comment at: clang/test/SemaOpenCL/unsupported-image.cl:1 +// RUN: %clang_cc1 -verify -cl-std=CL3.0 -cl-ext=-__opencl_c_images %s +// RUN: %clang_cc1 -verify -cl-std=CL3.0 -cl-ext=+__opencl_c_images %s Anastasia wrote: > svenvh wro

[PATCH] D104040: [OpenCL] Add TableGen emitter for OpenCL builtin header

2021-06-17 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov accepted this revision. azabaznov added a comment. This revision is now accepted and ready to land. Thanks for working on this! That's cool, I managed to reproduce something similar to https://reviews.llvm.org/D99577. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D103911: [OpenCL] Add support of __opencl_c_images feature macro

2021-06-17 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 352681. azabaznov added a comment. Set SPIR target for added test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103911/new/ https://reviews.llvm.org/D103911 Files: clang/lib/Sema/SemaType.cpp clang/test/

[PATCH] D103191: [OpenCL] Add support of __opencl_c_program_scope_global_variables feature macro

2021-06-17 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 352723. azabaznov added a comment. Restructured test, added comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103191/new/ https://reviews.llvm.org/D103191 Files: clang/include/clang/Basic/OpenCLOption

[PATCH] D103911: [OpenCL] Add support of __opencl_c_images feature macro

2021-06-21 Thread Anton Zabaznov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGa42739055835: [OpenCL] Add support of __opencl_c_images feature macro (authored by azabaznov). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103911/new/ htt

[PATCH] D107154: [OpenCL] Add support of __opencl_c_pipes feature macro.

2021-07-30 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov created this revision. azabaznov added reviewers: Anastasia, svenvh. Herald added subscribers: ldrumm, dexonsmith, yaxunl. azabaznov requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. 'pipe' keyword is introduced in OpenCL C 2.0: so

[PATCH] D107154: [OpenCL] Add support of __opencl_c_pipes feature macro.

2021-07-30 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 363044. azabaznov added a comment. Fix doubling run lines, misprint Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107154/new/ https://reviews.llvm.org/D107154 Files: clang/include/clang/Basic/LangOptions.d

[PATCH] D106778: [OpenCL] opencl-c.h: add CL 3.0 non-generic address space atomics

2021-07-30 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. @airlied, can you please fix that to something like here https://godbolt.org/z/3Kbso8ca3? What currently we do have with your patch is that generic address space overload is always selected, but more strict overloading always exist in OpenCL C 3.0 (https://godbolt.org

[PATCH] D107154: [OpenCL] Add support of __opencl_c_pipes feature macro.

2021-07-30 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. > 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 di

[PATCH] D107154: [OpenCL] Add support of __opencl_c_pipes feature macro.

2021-07-30 Thread Anton Zabaznov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGacc58504952f: [OpenCL] Add support of __opencl_c_pipes feature macro. (authored by azabaznov). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107154/new/ htt

[PATCH] D107176: [OpenCL] Replace test for pipe struct to test it with fixed triple

2021-07-30 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov created this revision. azabaznov added a reviewer: Anastasia. Herald added subscribers: ldrumm, yaxunl. azabaznov requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D107

[PATCH] D107176: [OpenCL] Replace test for pipe struct to test it with fixed triple

2021-07-30 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 363155. azabaznov added a comment. Restore original test name which was changed in D106748 , use check-prefixes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107176/new/ htt

[PATCH] D107176: [OpenCL] Replace test for pipe struct to test it with fixed triple

2021-07-30 Thread Anton Zabaznov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4e124ff25681: [OpenCL] Replace test for pipe struct to test it with fixed triple (authored by azabaznov). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D10717

[PATCH] D107318: [OpenCL] allow generic address and non-generic defs for CL3.0

2021-08-03 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. Yeah, this looks good. Thanks! Please notify when this is ready to land. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107318/new/ https://reviews.llvm.org/D107318 ___ cfe-comm

[PATCH] D104915: [OpenCL] Add support of __opencl_c_read_write_images feature macro

2021-06-25 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov created this revision. azabaznov added reviewers: Anastasia, svenvh. Herald added subscribers: ldrumm, yaxunl. Herald added a reviewer: aaron.ballman. azabaznov requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This feature requires

[PATCH] D104915: [OpenCL] Add support of __opencl_c_read_write_images feature macro

2021-07-01 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 355853. azabaznov added a comment. Addressed latest review comments, also refactored the patch by putting diagnostics into OpenCLOptions Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104915/new/ https://revi

[PATCH] D103401: [OpenCL] Add support of __opencl_c_generic_address_space feature macro

2021-07-01 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 355873. azabaznov added a comment. Added FIXME. Alternatively, we could add this language option only in `::adjust` if there is still a worry about multiple places of definitions. Btw, there will some more language options which dependent on target setting

[PATCH] D103191: [OpenCL] Add support of __opencl_c_program_scope_global_variables feature macro

2021-07-01 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 355884. azabaznov added a comment. Fixed latest comment about checking for `== 300`. Btw, there already exists a few places where `>= 300` is checked. Should fix them as well. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://revi

[PATCH] D104915: [OpenCL] Add support of __opencl_c_read_write_images feature macro

2021-07-01 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 355890. azabaznov added a comment. Fixed naming of new methods, fixed comments, removed redundant comments from source file Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D104915/new/ https://reviews.llvm.org/

[PATCH] D103401: [OpenCL] Add support of __opencl_c_generic_address_space feature macro

2021-07-13 Thread Anton Zabaznov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG78463ebde2f8: [OpenCL] Add support of __opencl_c_generic_address_space feature macro (authored by azabaznov). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D1

[PATCH] D103191: [OpenCL] Add support of __opencl_c_program_scope_global_variables feature macro

2021-07-13 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 358236. azabaznov added a comment. Update test after generic AS was merged Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103191/new/ https://reviews.llvm.org/D103191 Files: clang/include/clang/Basic/OpenCL

[PATCH] D104915: [OpenCL] Add support of __opencl_c_read_write_images feature macro

2021-07-13 Thread Anton Zabaznov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGab76101f40f8: [OpenCL] Add support of __opencl_c_read_write_images feature macro (authored by azabaznov). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D10491

[PATCH] D105892: [NFC] Silence build warning by placing parentheses around condition

2021-07-13 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov created this revision. azabaznov added reviewers: Anastasia, thakis. Herald added a reviewer: aaron.ballman. azabaznov requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Repository: rG LLVM Github Monorepo https://reviews.llvm.org

[PATCH] D104915: [OpenCL] Add support of __opencl_c_read_write_images feature macro

2021-07-13 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added inline comments. Comment at: clang/lib/Sema/SemaDeclAttr.cpp:7412 +!S.getOpenCLOptions().isSupported("__opencl_c_read_write_images", + S.getLangOpts( || DeclTy->isPipeType()) { ---

[PATCH] D105892: [NFC] Silence build warning by placing parentheses around condition

2021-07-13 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 358265. azabaznov added a comment. Add comment for C++ for OpenCL, add variable to check support for OpenCL C Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D105892/new/ https://reviews.llvm.org/D105892 Files:

[PATCH] D105892: [OpenCL] Add verbosity when checking support of read_write images

2021-07-13 Thread Anton Zabaznov via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG03d8fed34951: [OpenCL] Add verbosity when checking support of read_write images (authored by azabaznov). Repository: rG LLVM Github Monorepo CHAN

[PATCH] D105858: opencl-c.h: add 3.0 optional extension support for a few more bits

2021-07-13 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added inline comments. Comment at: clang/lib/Headers/opencl-c-base.h:329 #endif // defined(__opencl_c_atomic_scope_all_devices) -#if defined(cl_intel_subgroups) || defined(cl_khr_subgroups) +#if defined(cl_intel_subgroups) || defined(cl_khr_subgroups) || defined(__ope

[PATCH] D108392: [OpenCL] Fix parsing of opencl-c.h in CL 3.0 with device-scope atomics enabled

2021-11-04 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added inline comments. Comment at: clang/include/clang/Basic/OpenCLExtensions.def:114 +OPENCL_OPTIONALCOREFEATURE(__opencl_c_atomic_scope_device, false, 300, OCL_C_30) +OPENCL_OPTIONALCOREFEATURE(__opencl_c_atomic_scope_all_devices, false, 300, OCL_C_30) OPENCL_OPTIO

[PATCH] D112230: [OpenCL] Add support of __opencl_c_device_enqueue feature macro.

2021-11-11 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. Herald added a subscriber: Naghasan. > How about we clarify with Khronos whether it would be sufficient to add a > restriction like: > >> Program scope blocks are only supported when program scope variables feature >> is supported. That's sounds good to me. Especially

[PATCH] D112230: [OpenCL] Add support of __opencl_c_device_enqueue feature macro.

2021-11-11 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added inline comments. Comment at: clang/lib/AST/ExprConstant.cpp:9554 + +const auto &OpenCLFeaturesMap = +Info.Ctx.getTargetInfo().getSupportedOpenCLOpts(); azabaznov wrote: > Anastasia wrote: > > What test case covers this change? It feels

[PATCH] D97052: [OpenCL] Prevent adding extension pragma by default

2021-03-02 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. Thanks for working on this. LGTM in general. I'll let Marco comment on the latest changes. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97052/new/ https://reviews.llvm.org/D97052 ___ cfe-commits mailing list cfe-c

[PATCH] D97058: [OpenCL] Refactor diagnostic for OpenCL extension/feature

2021-03-03 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 327767. azabaznov added a comment. Check 'isEnabled' is now private: it is used only for non-core or non-optional core features; creation of implicit type definitions is guarder with extension support check; minor refactoring Repository: rG LLVM Github

[PATCH] D97058: [OpenCL] Refactor diagnostic for OpenCL extension/feature

2021-03-03 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added inline comments. Comment at: clang/lib/Basic/OpenCLOptions.cpp:22-26 + auto &OptInfo = OptMap.find(Ext)->getValue(); + if (OptInfo.isCoreIn(LO) || OptInfo.isOptionalCoreIn(LO)) +return isSupported(Ext, LO); + + return isEnabled(Ext); Note t

[PATCH] D97058: [OpenCL] Refactor diagnostic for OpenCL extension/feature

2021-03-04 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added inline comments. Comment at: clang/lib/Sema/Sema.cpp:364 for (auto &I : Atomic64BitTypes) setOpenCLExtensionForType(I, "cl_khr_int64_base_atomics cl_khr_int64_extended_atomics"); Anastasia wrote: > I think this should

[PATCH] D97869: [OpenCL][Draft] Add OpenCL builtin test generator

2021-03-04 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. That's awesome! I'm thinking of how can you track correctness of generated built-ins according to spec.  Perhaps you can compare the number of distinct declarations for each  built-in in the spec and in tablegen and diagnose if they are not equal. This is a very stra

[PATCH] D97058: [OpenCL] Refactor diagnostic for OpenCL extension/feature

2021-03-10 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 329554. azabaznov added a comment. Corrected some mistakes, added a test for diagnosing undeclared identifiers when a extension is unsupported. Generally leaving the change as it is as completely removing pragma may break backward compatibility now: let's

[PATCH] D97058: [OpenCL] Refactor diagnostic for OpenCL extension/feature

2021-03-10 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 329560. azabaznov added a comment. Replaced atomic_double implicit definition Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97058/new/ https://reviews.llvm.org/D97058 Files: clang/include/clang/Basic/Diagn

[PATCH] D97058: [OpenCL] Refactor diagnostic for OpenCL extension/feature

2021-03-10 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. > Ok, addressing in a separate patch is reasonable, but why do you think that > we will break backward compatibility? My current worry is that the > implementation is so messy and inconsistent that it will take us longer time > if we do the incremental steps. Also, we

[PATCH] D97058: [OpenCL] Refactor diagnostic for OpenCL extension/feature

2021-03-12 Thread Anton Zabaznov via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG840643bbe1d2: [OpenCL] Refactor diagnostic for OpenCL extension/feature (authored by azabaznov). Changed prior to commit: https://reviews.llvm.org

[PATCH] D97058: [OpenCL] Refactor diagnostic for OpenCL extension/feature

2021-03-12 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. Hi! Yeah,  I'm looking into it, but I can't reproduce it locally: the test passes at x86_64 linux system. I'll revert the change if it takes too much time to investigate what's going on. Thanks. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION http

[PATCH] D97058: [OpenCL] Refactor diagnostic for OpenCL extension/feature

2021-03-12 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. Thanks guys, I'm on way to trying that, just building clang from scratch. >   If it is, then just adding a fixed triple is fine. Yeah, it is expected as this change removes types which require extension from parsers state. X86 and SPIR support all extensions by defau

[PATCH] D98539: [OpenCL] Set target as spir for c-index-test for OpenCL

2021-03-12 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov created this revision. azabaznov added reviewers: Anastasia, svenvh, thakis. Herald added subscribers: arphaman, yaxunl. azabaznov requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Otherwise (for other targets) testing may be non-de

[PATCH] D97058: [OpenCL] Refactor diagnostic for OpenCL extension/feature

2021-03-12 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. Yes, I was able to reproduce the failure with `-target arm64-apple-macosx` flag, I provided the fix to set explicit target: https://reviews.llvm.org/D98539. @Anastasia, I tried to cherry-pick https://reviews.llvm.org/D92244, but the error is still reproducible. Rep

[PATCH] D97058: [OpenCL] Refactor diagnostic for OpenCL extension/feature

2021-03-15 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. > Do you also get fatal error: 'opencl-c-base.h' file not found? If so, we > might need at least to file a clang bug that we should look at before the > next release. I'm able to reproduce it when not setting `-target` option explicitly: $ ./build_release/bin/c-ind

[PATCH] D98539: [OpenCL] Set target as spir for c-index-test for OpenCL

2021-03-15 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. @Anastasia, thanks for landing this! Sorry for delay, I though that this can wait until Monday Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98539/new/ https://reviews.llvm.org/D98539 ___

[PATCH] D115640: [OpenCL] Add support of __opencl_c_device_enqueue feature macro.

2022-01-25 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 402873. azabaznov added a comment. Add expected-no-diagnostics, fix misprint in test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115640/new/ https://reviews.llvm.org/D115640 Files: clang/include/clang/B

[PATCH] D115640: [OpenCL] Add support of __opencl_c_device_enqueue feature macro.

2022-01-25 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov marked an inline comment as done. azabaznov added inline comments. Comment at: clang/test/SemaOpenCL/storageclass.cl:2 // RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL1.2 -// RUN: %clang_cc1 %s -verify -pedantic -fsyntax-only -cl-std=CL3.0 -cl-ext=-__o

[PATCH] D115640: [OpenCL] Add support of __opencl_c_device_enqueue feature macro.

2022-01-27 Thread Anton Zabaznov via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGa5de66c4c50b: [OpenCL] Add support of __opencl_c_device_enqueue feature macro. (authored by azabaznov). Repository: rG LLVM Github Monorepo CHANG

[PATCH] D118605: [OpenCL] Add support of language builtins for OpenCL C 3.0

2022-01-31 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov created this revision. azabaznov added reviewers: Anastasia, svenvh. Herald added subscribers: Naghasan, ldrumm, yaxunl. azabaznov requested review of this revision. Herald added a reviewer: jdoerfert. Herald added subscribers: cfe-commits, sstefan1. Herald added a project: clang. OpenCL

[PATCH] D118605: [OpenCL] Add support of language builtins for OpenCL C 3.0

2022-01-31 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 404511. azabaznov added a comment. Remove no longer required comment in the test. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D118605/new/ https://reviews.llvm.org/D118605 Files: clang/include/clang/Basic

[PATCH] D118605: [OpenCL] Add support of language builtins for OpenCL C 3.0

2022-02-01 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added inline comments. Comment at: clang/include/clang/Basic/Builtins.def:88 // '__builtin_' prefix. It will be implemented in compiler-rt or libgcc. +// G -> this function uses generic address space (OpenCL). +// P -> this function uses pipes (OpenCL). ---

[PATCH] D118605: [OpenCL] Add support of language builtins for OpenCL C 3.0

2022-02-02 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added inline comments. Comment at: clang/include/clang/Basic/Builtins.def:88 // '__builtin_' prefix. It will be implemented in compiler-rt or libgcc. +// G -> this function uses generic address space (OpenCL). +// P -> this function uses pipes (OpenCL). ---

[PATCH] D120254: [OpenCL] Align subgroup builtin guards

2022-02-22 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov accepted this revision. azabaznov added a comment. This revision is now accepted and ready to land. LGTM! Thanks! Comment at: clang/lib/Headers/opencl-c-base.h:85 +// Internal feature macro to provide subgroup builtins. +#define __opencl_subgroup_builtins 1 +#endif --

[PATCH] D100984: [OpenCL] Remove the need for subgroupd extension pragma in enqueue kernel builtins

2021-04-22 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. > Btw I am not suggesting removing the pragma. We will still have to parse it > for backward compatibility. I am only dropping the requirement of using it in > order to call get_kernel_max_sub_group_size_for_ndrange or > get_kernel_sub_group_count_for_ndrange when the

[PATCH] D101087: [OpenCL] Introduce new method for validating OpenCL target

2021-04-22 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov created this revision. azabaznov added reviewers: Anastasia, svenvh. Herald added subscribers: ldrumm, jfb, yaxunl, jvesely. azabaznov requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Language options are not available when a targe

[PATCH] D96524: [OpenCL] Add support of OpenCL C 3.0 __opencl_c_fp64

2021-04-22 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. Please see https://reviews.llvm.org/D101087. I think unifying with target features requires more effort than it seemed because target features are declared in LLVM (see for example //AMDGPUFeatureKV // in //AMDGPUGenSubtargetInfo.inc//, //llvm/lib/Target/AMDGPU/AMDGPU

[PATCH] D100984: [OpenCL] Remove the need for subgroups extension pragma in enqueue kernel builtins

2021-04-23 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov accepted this revision. azabaznov added a comment. This revision is now accepted and ready to land. LGTM! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100984/new/ https://reviews.llvm.org/D100984 ___ cfe-commits mailing list cfe-co

[PATCH] D100980: [OpenCL] Allow use of double type without extension pragma

2021-04-23 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. > do you think it is valuable to keep this behavior at all? As I said, I would be happy too if we remove pragma extension as it will really simplify the codebase of OpenCL in clang and the usage of optional functionality itself. Maybe we should add a diagnostic that p

[PATCH] D101087: [OpenCL] Introduce new method for validating OpenCL target

2021-04-23 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 339983. azabaznov added a comment. Herald added a reviewer: aaron.ballman. Addressed comments, did some more refactoring. Is it OK to have "2.0" diagnostics for C++ for OpenCL? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://rev

[PATCH] D100980: [OpenCL] Allow use of double type without extension pragma

2021-04-23 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. > For cl_khr_fp64 I still want to keep the pragma for the other use case - to > convert double literal into single-precision > (https://github.com/KhronosGroup/OpenCL-Docs/issues/578). The reason why I > think it could be useful is that the precision change might lead

[PATCH] D101087: [OpenCL] Introduce new method for validating OpenCL target

2021-04-23 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 340053. azabaznov added a comment. Use `LangOptions::getOpenCLVersionTuple()` to provide diagnostics of OpenCL version Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101087/new/ https://reviews.llvm.org/D1010

[PATCH] D101087: [OpenCL] Introduce new method for validating OpenCL target

2021-04-23 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added inline comments. Comment at: clang/include/clang/Basic/OpenCLOptions.h:179 + static bool isOpenCLOptionCoreIn(const LangOptions &LO, Args &&... args) { +return OpenCLOptionInfo(std::forward(args)...).isCoreIn(LO); + } Anastasia wrote: > Do y

[PATCH] D100980: [OpenCL] Allow use of double type without extension pragma

2021-04-23 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. > We could of course keep it just for this particular case of doubles, but even > half is allowed in certain circumstances without the pragma and it is still > an extension. https://godbolt.org/z/K34sP81nx I am confused again... after looking into //OpenCL C 1.0, 9.10

[PATCH] D100980: [OpenCL] Allow use of double type without extension pragma

2021-04-27 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. > Anyway since there is not clear benefit that can be found now for the pragma > I think we should minimize its use as much as possible. Unfortunately it's already there :( > Anyway since there is not clear benefit that can be found now for the pragma > I think we sh

[PATCH] D100980: [OpenCL] Allow use of double type without extension pragma

2021-04-27 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. > When the pragma is parsed we can't know why it is in the code to be able to > issue any warning. I mean diagnose once when, for example in your particular case, double type is parsed. Does it require much effort? I think this warning might be useful for developers

[PATCH] D100983: [OpenCL] Fix optional image types

2021-04-27 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov accepted this revision. azabaznov added a comment. This revision is now accepted and ready to land. Generally looks good to me, but maybe a test needed, see a comment. Thanks! But I'm still not sure about completely removing pragmas for type declarations (see https://reviews.llvm.org/D

[PATCH] D100980: [OpenCL] Allow use of double type without extension pragma

2021-04-28 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. In D100980#2719322 , @Anastasia wrote: > In D100980#2719196 , @azabaznov > wrote: > >>> When the pragma is parsed we can't know why it is in the code to be able to >>> issue any warnin

[PATCH] D100983: [OpenCL] Fix optional image types

2021-04-28 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added inline comments. Comment at: clang/include/clang/Basic/OpenCLImageTypes.def:68 IMAGE_WRITE_TYPE(image2d_array_msaa_depth, OCLImage2dArrayMSAADepth, "cl_khr_gl_msaa_sharing") -IMAGE_WRITE_TYPE(image3d, OCLImage3d, "cl_khr_3d_image_writes") +IMAGE_WRITE_TYPE(image

[PATCH] D101087: [OpenCL] Introduce new method for validating OpenCL target

2021-04-28 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 341119. azabaznov added a comment. Add test for C++ for OpenCL diagnostics Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D101087/new/ https://reviews.llvm.org/D101087 Files: clang/include/clang/Basic/Diagno

[PATCH] D100980: [OpenCL] Allow use of double type without extension pragma

2021-04-28 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. > Not sure what do we want to achieve with this? Do you want to point out that > the code might be somehow less portable let's say between clang revisions, > etc? My main worry is that you are changing the behaviour here: kernels which fail to compile will compile su

[PATCH] D101087: [OpenCL] Introduce new method for validating OpenCL target

2021-04-28 Thread Anton Zabaznov via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGf0efc0075131: [OpenCL] Introduce new method for validating OpenCL target (authored by azabaznov). Changed prior to commit: https://reviews.llvm.org/D101087?vs=341119&id=341170#toc Repository: rG LLVM

[PATCH] D100983: [OpenCL] Fix optional image types

2021-05-04 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov accepted this revision. azabaznov added a comment. LGTM. Thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D100983/new/ https://reviews.llvm.org/D100983 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.o

[PATCH] D100980: [OpenCL] Allow use of double type without extension pragma

2021-05-04 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov accepted this revision. azabaznov added a comment. This revision is now accepted and ready to land. Thanks! Looks good to me in general. See a comment. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:10006 "use of %select{type|declaration}0 %1 requires

[PATCH] D96524: [OpenCL] Add support of OpenCL C 3.0 __opencl_c_fp64

2021-05-06 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 343417. azabaznov added a comment. Rebased to use `::validateOpenCLTarget`. Decided to use explicit simulatneous extensions/feature disabling in command line due to API spec limitations: clGetDeviceInfo: Will not describe support for the cl_khr_3d_image_wr

[PATCH] D100980: [OpenCL] Allow use of double type without extension pragma

2021-05-07 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:10006 "use of %select{type|declaration}0 %1 requires %2 support">; +def ext_opencl_double_without_pragma : Extension< + "Clang permits use of type 'double' regardless pragma if 'cl_k

[PATCH] D115640: [OpenCL] Add support of __opencl_c_device_enqueue feature macro.

2022-01-12 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added inline comments. Comment at: clang/test/Misc/opencl-c-3.0.incorrect_options.cl:21 + // CHECK-FP64: error: options cl_khr_fp64 and __opencl_c_fp64 are set to different values Anastasia wrote: > Anastasia wrote: > > I can't remember if we have d

[PATCH] D115640: [OpenCL] Add support of __opencl_c_device_enqueue feature macro.

2022-01-12 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 399269. azabaznov added a comment. Rebase, remove extra 'verify' Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115640/new/ https://reviews.llvm.org/D115640 Files: clang/include/clang/Basic/DiagnosticSemaKi

[PATCH] D115640: [OpenCL] Add support of __opencl_c_device_enqueue feature macro.

2021-12-13 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov created this revision. azabaznov added reviewers: Anastasia, svenvh. Herald added subscribers: Naghasan, ldrumm, yaxunl. azabaznov requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This feature requires support of __opencl_c_generic

[PATCH] D112230: [OpenCL] Add support of __opencl_c_device_enqueue feature macro.

2021-12-13 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov abandoned this revision. azabaznov added a comment. Now program scope global variables are required by device enqueue in the spec, new patch for device enqueue support: https://reviews.llvm.org/D115640 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.

[PATCH] D115640: [OpenCL] Add support of __opencl_c_device_enqueue feature macro.

2021-12-20 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 395390. azabaznov added a comment. Simplified running lines in tests, use 'verify' when validating features, simplify condition in Sema Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D115640/new/ https://revie

[PATCH] D115640: [OpenCL] Add support of __opencl_c_device_enqueue feature macro.

2021-12-20 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov marked 3 inline comments as done. azabaznov added inline comments. Comment at: clang/test/SemaOpenCL/invalid-device-enqueue-types-cl3.0.cl:5 +void f() { + clk_event_t e; + queue_t q; Anastasia wrote: > I know that many test have prefix "invalid" but I

[PATCH] D97869: [OpenCL][Draft] Add OpenCL builtin test generator

2021-03-16 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. I have one more though. I like the idea of turning `opencl-c.h` into the test: as it is already in the repo and is already being used for quite a while we can assume it as a mainline for now. I think the first step should be to test that `-fdeclare-oprencl-builtins`

[PATCH] D99577: [RFC][OpenCL][PoC] Testing TableGen with diffing

2021-03-30 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov created this revision. azabaznov added reviewers: svenvh, Anastasia. Herald added subscribers: ldrumm, yaxunl. azabaznov requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. This adds an option string to clang-check to ignore certain A

[PATCH] D99425: [OpenCL] Fix parsing of opencl-c.h in CL 3.0

2021-03-30 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. Thanks for  the patch! Sorry for the delay Can you please elaborate on what issue you are trying to resolve with this fix? You're trying to emit diagnostics for `cl_khr_3d_image_writes` for OpenCL C 3.0? FYI `cl_khr_3d_image_writes` should have no effect in `-cl-ext`

[PATCH] D99425: [OpenCL] Fix parsing of opencl-c.h in CL 3.0

2021-03-30 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov accepted this revision. azabaznov added a comment. Looks good to me. Thanks! > Without this change, opencl-c.h cannot be parsed with -cl-std=CL3.0 as the > write_only image3d_t type is not enabled. This should be fixed in the following up patches to check for `__opencl_c_3d_image_wri

[PATCH] D99577: [RFC][OpenCL][PoC] Testing TableGen with diffing

2021-04-01 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. Thanks for feedback! Locally I get really nice result (I am using Ubuntu 20.04): $ llvm-lit SemaOpenCL/compare-header-and-tablegen.cl -- Testing: 1 tests, 1 workers -- FAIL: Clang :: SemaOpenCL/compare-header-and-tablegen.cl (1 of 1)

[PATCH] D99969: [OpenCL] Accept .rgba in OpenCL 3.0

2021-04-07 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. Thanks for working on this! Looks good to me in general. I have a small comment. Comment at: clang/lib/Sema/SemaExprMember.cpp:343 if (HasRGBA || (*compStr && IsRGBA(*compStr))) { - if (S.getLangOpts().OpenCL && S.getLangOpts().OpenCLVersion

[PATCH] D96524: [OpenCL] Add support of OpenCL C 3.0 __opencl_c_fp64

2021-04-09 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added inline comments. Comment at: clang/lib/Basic/TargetInfo.cpp:398 +auto CLVer = Opts.OpenCLCPlusPlus ? 200 : Opts.OpenCLVersion; +if (CLVer >= 300) { + auto &OCLOpts = getSupportedOpenCLOpts(); Anastasia wrote: > azabaznov wrote: > > An

[PATCH] D96524: [OpenCL] Add support of OpenCL C 3.0 __opencl_c_fp64

2021-04-15 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. My main idea was to provide an interface which will not make users to specify `-cl-ext=+__opencl_c_fp64,+cl_khr_fp64`/ `-cl-ext=-__opencl_c_fp64,-cl_khr_fp64` if they need to enable/disable functionality in OpenCL C 3.0 because I believe that is not a right thing to

[PATCH] D100492: [OpenCL] Change OpenCL builtin version encoding

2021-04-15 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov accepted this revision. azabaznov added a comment. This revision is now accepted and ready to land. Great! And thanks for fixing misprint :) Comment at: clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp:507 +if (VersionIDs[I] >= MinVersion && VersionIDs[I] < MaxV

[PATCH] D100492: [OpenCL] Change OpenCL builtin version encoding

2021-04-15 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added inline comments. Comment at: clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp:507 +if (VersionIDs[I] >= MinVersion && VersionIDs[I] < MaxVersion) { + Encoded |= 1 << I; +} svenvh wrote: > azabaznov wrote: > > nit: Encoded |= clang::

[PATCH] D96524: [OpenCL] Add support of OpenCL C 3.0 __opencl_c_fp64

2021-04-21 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. In D96524#2692376 , @Anastasia wrote: > In D96524#2691428 , @azabaznov wrote: > >> My main idea was to provide an interface which will not make users to >> specify `-cl-ext=+__opencl_c_fp

[PATCH] D100984: [OpenCL] Remove the need for subgroupd extension pragma in enqueue kernel builtins

2021-04-22 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. I wish it could be true... But `cl_khr_subgroups` still requires pragma in some versions as it wasn't a core feature earlier (https://www.khronos.org/registry/OpenCL/sdk/2.2/docs/man/html/cl_khr_subgroups.html). I know that we are going around in circles and we discus

[PATCH] D100976: [OpenCL] Simplify use of C11 atomic types

2021-04-22 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added inline comments. Comment at: clang/test/Parser/opencl-atomics-cl20.cl:7-8 -#ifdef EXT -#pragma OPENCL EXTENSION cl_khr_int64_base_atomics:enable -#pragma OPENCL EXTENSION cl_khr_int64_extended_atomics:enable -#pragma OPENCL EXTENSION cl_khr_fp64:enable -#if __OP

[PATCH] D100980: [OpenCL] Allow use of double type without extension pragma

2021-04-22 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov added a comment. Same as for https://reviews.llvm.org/D100984, `cl_khr_fp64` wasn't always core and thus it requires pragma for OpenCL C < 1.2 versions. //9.3 Double Precision Floating-Point, OpenCL C 1.0// (https://www.khronos.org/registry/OpenCL/specs/opencl-1.0.pdf): OpenCL 1.0

[PATCH] D92277: [OpenCL] Refactor of targets OpenCL option settings

2021-01-14 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov updated this revision to Diff 316627. azabaznov added a comment. Changes in the latest patch: 1. Removed XFAIL and OpenCL C 2.0 test running for r600 and NVPTX target 2. Fixed comments. 3. Core features are being set in `TargetInfo::adjust`. CHANGES SINCE LAST ACTION https://revie

[PATCH] D92277: [OpenCL] Refactor of targets OpenCL option settings

2021-01-14 Thread Anton Zabaznov via Phabricator via cfe-commits
azabaznov marked 14 inline comments as done. azabaznov added inline comments. Comment at: clang/include/clang/Basic/TargetInfo.h:1431 /// Set supported OpenCL extensions and optional core features. + virtual void setSupportedOpenCLOpts(const LangOptions &Opts) {} --

<    1   2   3   >