[PATCH] D95778: [OpenCL] Introduce new language options for OpenCL keywords.

2021-02-02 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added a comment. LGTM, but perhaps you can add a test that has each keyword disabled? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95778/new/ https://reviews.llvm.org/D95778 ___ cfe-commits maili

[PATCH] D95523: [OpenCL] Add cl_khr_subgroup_ballot to TableGen BIFs

2021-02-02 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/test/SemaOpenCL/fdeclare-opencl-builtins.cl:35 +// Enable extensions that are enabled in opencl-c-base.h. +#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ >= 200) +#define cl_khr_subgroup_ballot 1 Anast

[PATCH] D95616: [OpenCL] Change extension handling for -fdeclare-opencl-builtins

2021-02-02 Thread Sven van Haastregt 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 rGdc00c96b2d1b: [OpenCL] Change extension handling for -fdeclare-opencl-builtins (authored by svenvh). Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D95776: [OpenCL] Add macro definitions of OpenCL C 3.0 features

2021-02-02 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/lib/Headers/opencl-c.h:17161 +#if (defined(__OPENCL_CPP_VERSION__) || __OPENCL_C_VERSION__ == 200) +#undef __opencl_c_pipes +#undef __opencl_c_generic_address_space Anastasia wrote: > Looping in @svenvh - I don't m

[PATCH] D95778: [OpenCL] Introduce new language options for OpenCL keywords.

2021-02-02 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added a comment. In D95778#2536266 , @Anastasia wrote: >> LGTM, but perhaps you can add a test that has each keyword disabled? > > FYI we currently already test that `pipe` and `generic` are valid for OpenCL > 2.0 and invalid for OpenCL < 2.0. Or d

[PATCH] D95523: [OpenCL] Add cl_khr_subgroup_ballot to TableGen BIFs

2021-02-02 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/test/SemaOpenCL/fdeclare-opencl-builtins.cl:141 +kernel void extended_subgroup(global uint4 *out) { + out[0] = get_sub_group_eq_mask(); +#if __OPENCL_C_VERSION__ < CL_VERSION_2_0 && !defined(__OPENCL_CPP_VERSION__)

[PATCH] D95523: [OpenCL] Add cl_khr_subgroup_ballot to TableGen BIFs

2021-02-03 Thread Sven van Haastregt 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 rG9caf364d69db: [OpenCL] Add cl_khr_subgroup_ballot to TableGen BIFs (authored by svenvh). Changed prior to commit: https://reviews.llvm.org/D95523?

[PATCH] D95886: [OpenCL][Docs] Link page explaining tooling for offline compilation

2021-02-03 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/docs/UsersManual.rst:2835 `_ -to produce SPIR-V binary. - +to produce SPIR-V binary. More detail are provided in the following +online resource - `the offline compilation from

[PATCH] D95951: [OpenCL] Add cl_khr_subgroup_non_uniform_arithmetic to TableGen BIFs

2021-02-03 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. svenvh added a reviewer: Anastasia. svenvh added a project: clang. Herald added a subscriber: yaxunl. svenvh requested review of this revision. Herald added a subscriber: cfe-commits. Add the builtin functions brought by the cl_khr_subgroup_non_uniform_arithmetic ext

[PATCH] D95778: [OpenCL] Introduce new language options for OpenCL keywords.

2021-02-04 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh accepted this revision. svenvh added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95778/new/ https://reviews.llvm.org/D95778 ___

[PATCH] D95886: [OpenCL][Docs] Link page explaining tooling for offline compilation

2021-02-04 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh accepted this revision. svenvh added a comment. This revision is now accepted and ready to land. LGTM, thanks! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D95886/new/ https://reviews.llvm.org/D95886 ___ cfe-commits mailing list cfe-co

[PATCH] D96050: [OpenCL] Do not enforce ASTContext for OCL2Qual

2021-02-04 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. svenvh added a reviewer: Anastasia. svenvh added a project: clang. Herald added subscribers: jfb, yaxunl. svenvh requested review of this revision. Herald added a subscriber: cfe-commits. Do not enforce that the expression to obtain the `QualType` for an OpenCL type s

[PATCH] D96051: [OpenCL] Support enum and typedef args in TableGen BIFs

2021-02-04 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. svenvh added a reviewer: Anastasia. svenvh added a project: clang. Herald added subscribers: jfb, yaxunl. svenvh requested review of this revision. Herald added a subscriber: cfe-commits. Add enum and typedef argument support to `-fdeclare-opencl-builtins`, which was

[PATCH] D95951: [OpenCL] Add cl_khr_subgroup_non_uniform_arithmetic to TableGen BIFs

2021-02-05 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/lib/Sema/OpenCLBuiltins.td:1529 + foreach name = ["reduce_", "scan_exclusive_", "scan_inclusive_"] in { +foreach op = ["add", "min", "max", "mul"] in { + def : Builtin<"sub_group_non_uniform_" # name # op, [AGenType1, AGe

[PATCH] D96051: [OpenCL] Support enum and typedef args in TableGen BIFs

2021-02-05 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/test/SemaOpenCL/fdeclare-opencl-builtins.cl:38 +typedef uint cl_mem_fence_flags; +#define CLK_GLOBAL_MEM_FENCE 0x02 + Anastasia wrote: > Should we add this conditionally if the base header is not included? > > In

[PATCH] D96150: [OpenCL][Docs] Describe internals of TableGen BIFs

2021-02-05 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. svenvh added a reviewer: Anastasia. svenvh added a project: clang. Herald added a subscriber: yaxunl. svenvh requested review of this revision. Herald added a subscriber: cfe-commits. Add a high level explanation of the `-fdeclare-opencl-builtins` option. Repository

[PATCH] D108470: [OpenCL] Fix as_type3 invalid store creation

2021-09-29 Thread Sven van Haastregt via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG4da744a20ff5: [OpenCL] Fix as_type3 invalid store creation (authored by svenvh). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108470/new/ https://reviews.l

[PATCH] D110636: [OpenCL][NFC] Refactor vloada_half and vstorea_half decls

2021-09-29 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh accepted this revision. svenvh added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D110636/new/ https://reviews.llvm.org/D110636 ___

[PATCH] D109740: [OpenCL] Add atomic_half type builtins

2021-09-29 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added a comment. Looks good at a first quick glance, but please fix the formatting errors that are reported on the lines that you are adding. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D109740/new/ https://reviews.llvm.org/D109740 __

[PATCH] D96050: [OpenCL] Do not enforce ASTContext for OCL2Qual

2021-02-08 Thread Sven van Haastregt 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 rGa016374d079b: [OpenCL] Do not enforce ASTContext for OCL2Qual (authored by svenvh). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

[PATCH] D96051: [OpenCL] Support enum and typedef args in TableGen BIFs

2021-02-08 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh updated this revision to Diff 322123. svenvh added a comment. Do not assume cast to Enum/TypedefDecl is always successful. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96051/new/ https://reviews.llvm.org/D96051 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/l

[PATCH] D96279: [OpenCL] Add cl_khr_subgroup_extended_types to TableGen BIFs

2021-02-08 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. svenvh added a reviewer: Anastasia. svenvh added a project: clang. Herald added a subscriber: yaxunl. svenvh requested review of this revision. Herald added a subscriber: cfe-commits. Add the builtin functions brought by the cl_khr_subgroup_extended_types extension t

[PATCH] D95951: [OpenCL] Add cl_khr_subgroup_non_uniform_arithmetic to TableGen BIFs

2021-02-10 Thread Sven van Haastregt 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 rG9ae99a0de8c7: [OpenCL] Add cl_khr_subgroup_non_uniform_arithmetic to TableGen BIFs (authored by svenvh). Repository: rG LLVM Github Monorepo CHAN

[PATCH] D96178: [OpenCL] Create VoidPtrTy with generic AS in C++ for OpenCL mode

2021-02-10 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added a comment. In D96178#2551449 , @Anastasia wrote: > @svenvh We haven't looked into address spaces in details when adding this. I > wonder what behavior would make sense for new/delete? Do we plan to allow > new/delete in named address spaces

[PATCH] D96279: [OpenCL] Add cl_khr_subgroup_extended_types to TableGen BIFs

2021-02-11 Thread Sven van Haastregt 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 rG0b448854daff: [OpenCL] Add cl_khr_subgroup_extended_types to TableGen BIFs (authored by svenvh). Repository: rG LLVM Github Monorepo CHANGES SINC

[PATCH] D96051: [OpenCL] Support enum and typedef args in TableGen BIFs

2021-02-11 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh updated this revision to Diff 323040. svenvh added a comment. Add test for new diagnostic. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96051/new/ https://reviews.llvm.org/D96051 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td clang/lib/Sema/OpenCLBuiltins.td clan

[PATCH] D96150: [OpenCL][Docs] Describe internals of TableGen BIFs

2021-02-12 Thread Sven van Haastregt 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 rG18a70797e798: [OpenCL][Docs] Describe internals of TableGen builtins (authored by svenvh). Changed prior to commit: https://reviews.llvm.org/D9615

[PATCH] D96588: [OpenCL] Remove FIXME in getOpenCLFeatureDefines

2021-02-12 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. svenvh added reviewers: Anastasia, azabaznov. svenvh added a project: clang. Herald added a subscriber: yaxunl. svenvh requested review of this revision. Herald added a subscriber: cfe-commits. The suggestion in D92277 was to move `O

[PATCH] D96515: [OpenCL] Add builtin declarations by default.

2021-02-12 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added a comment. It probably makes sense to update `clang/docs/UsersManual.rst` as part of this change. In particular the following sentence is no longer true after this patch: "By default the OpenCL headers are not loaded and therefore certain builtin types and most of builtin function

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

2021-02-12 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/include/clang/Basic/OpenCLOptions.h:157 + // Is OpenCL C feature (OpenCL C 3.0, 6.2.1. Features) + bool isFeature(llvm::StringRef Ext) const; + The argument "Ext" suggests "Extension", so perhaps rename if this is

[PATCH] D96051: [OpenCL] Support enum and typedef args in TableGen BIFs

2021-02-12 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/test/SemaOpenCL/fdeclare-opencl-builtins.cl:27 + // expected-error@-3 0+{{no matching function for call to 'barrier'}} + // expected-error@* {{typedef type cl_mem_fence_flags not found; include the base header with -finclude-defa

[PATCH] D96616: [OpenCL][Docs] Change decription for the OpenCL standard headers

2021-02-16 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/docs/OpenCLSupport.rst:67 +All the options in this section are frontend-only and therefore if used +with regular clang driver they require frontend forwarding e.g. ``-cc1`` +or ``-Xclang``. Comme

[PATCH] D96789: [OpenCL] Move printf declaration to opencl-c-base.h

2021-02-16 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. svenvh added a reviewer: Anastasia. svenvh added a project: clang. Herald added a subscriber: yaxunl. svenvh requested review of this revision. Herald added a subscriber: cfe-commits. Supporting `printf` with `-fdeclare-opencl-builtins` would require special handling

[PATCH] D96771: [OpenCL] Add distinct file extension for C++ for OpenCL

2021-02-16 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/lib/Driver/Types.cpp:265 .Case("cl", TY_CL) + .Case("clcpp", TY_CLCXX) .Case("cp", TY_CXX) mantognini wrote: > I'm not sure we want that -- I'm actually fine if we don't -- but I se

[PATCH] D96860: [OpenCL] Add declarations with enum/typedef args

2021-02-17 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. svenvh added a reviewer: Anastasia. svenvh added a project: clang. Herald added subscribers: jfb, yaxunl. svenvh requested review of this revision. Herald added a subscriber: cfe-commits. Add the remaining missing builtin function declarations that have enum or typede

[PATCH] D96051: [OpenCL] Support enum and typedef args in TableGen BIFs

2021-02-17 Thread Sven van Haastregt via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG23d65aa44631: [OpenCL] Support enum and typedef args in TableGen BIFs (authored by svenvh). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96051/new/ https:/

[PATCH] D96515: [OpenCL] Add builtin declarations by default.

2021-02-17 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh accepted this revision. svenvh added a comment. This revision is now accepted and ready to land. LGTM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96515/new/ https://reviews.llvm.org/D96515 ___ cfe-commits mailing list cfe-commits@lis

[PATCH] D96789: [OpenCL] Move printf declaration to opencl-c-base.h

2021-02-18 Thread Sven van Haastregt 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 rG5a4a01460f1a: [OpenCL] Move printf declaration to opencl-c-base.h (authored by svenvh). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST AC

[PATCH] D96948: [OpenCL] Move remaining defines to opencl-c-base.h

2021-02-18 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. svenvh added a reviewer: Anastasia. svenvh added a project: clang. Herald added a subscriber: yaxunl. svenvh requested review of this revision. Herald added a subscriber: cfe-commits. Move any remaining preprocessor defines from `opencl-c.h` to `opencl-c-base.h`, such

[PATCH] D96616: [OpenCL][Docs] Change decription for the OpenCL standard headers

2021-02-18 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh accepted this revision. svenvh added a comment. This revision is now accepted and ready to land. LGTM! Comment at: clang/docs/UsersManual.rst:3016 .. code-block:: console Anastasia wrote: > svenvh wrote: > > I wonder if we need to keep this examp

[PATCH] D96948: [OpenCL] Move remaining defines to opencl-c-base.h

2021-02-19 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added a comment. In D96948#257 , @Anastasia wrote: > LGTM! Btw since we are moving this code anyway, do you think we could fix the > formatting? Sure, I'll do that before committing. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

[PATCH] D96860: [OpenCL] Add declarations with enum/typedef args

2021-02-19 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/lib/Sema/OpenCLBuiltins.td:932 +let MinVersion = CL20 in { + def : Builtin<"get_fence", [MemFenceFlags, PointerType]>; + def : Builtin<"get_fence", [MemFenceFlags, PointerType, GenericAS>]>; Anastasia wrote: > Bt

[PATCH] D97060: [OpenCL] Add ndrange builtin functions to TableGen

2021-02-19 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. svenvh added a reviewer: Anastasia. svenvh added a project: clang. Herald added a subscriber: yaxunl. svenvh requested review of this revision. Herald added a subscriber: cfe-commits. Add ndrange builtin functions to TableGen. Also ensure all kernel enqueue functions

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

2021-02-19 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/include/clang/Basic/OpenCLExtensions.def:24 +//its behavior explicitly is deprecated. Therefore the default +//value if false. // avail - minimum OpenCL version supporting it. typo =

[PATCH] D96948: [OpenCL] Move remaining defines to opencl-c-base.h

2021-02-23 Thread Sven van Haastregt 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 rG612d0ef1732f: [OpenCL] Move remaining defines to opencl-c-base.h (authored by svenvh). Changed prior to commit: https://reviews.llvm.org/D96948?vs

[PATCH] D96860: [OpenCL] Add declarations with enum/typedef args

2021-02-23 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh updated this revision to Diff 325783. svenvh added a comment. Add comment about `get_fence`. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96860/new/ https://reviews.llvm.org/D96860 Files: clang/lib/Sema/OpenCLBuiltins.td clang/test/SemaOpenCL/fdeclare-opencl-builtins.cl In

[PATCH] D96860: [OpenCL] Add declarations with enum/typedef args

2021-02-23 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/lib/Sema/OpenCLBuiltins.td:932 +let MinVersion = CL20 in { + def : Builtin<"get_fence", [MemFenceFlags, PointerType]>; + def : Builtin<"get_fence", [MemFenceFlags, PointerType, GenericAS>]>; Anastasia wrote: > sv

[PATCH] D96860: [OpenCL] Add declarations with enum/typedef args

2021-02-24 Thread Sven van Haastregt via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG85eb12eefdf6: [OpenCL] Add declarations with enum/typedef args (authored by svenvh). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96860/new/ https://review

[PATCH] D97060: [OpenCL] Add ndrange builtin functions to TableGen

2021-02-24 Thread Sven van Haastregt 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 rG0344aea6ea37: [OpenCL] Add ndrange builtin functions to TableGen (authored by svenvh). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACT

[PATCH] D97072: [OpenCL][Docs] Add guidelines for adding new extensions and features

2021-02-24 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added a comment. Some minor typos and requests for clarifications, looks like reasonable guidelines other than that. Comment at: clang/docs/OpenCLSupport.rst:175 + +If extensions modifies the standard parsing they need to be added to +the clang frontend source code. Thi

[PATCH] D97072: [OpenCL][Docs] Add guidelines for adding new extensions and features

2021-02-24 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/docs/OpenCLSupport.rst:196 +If an extension adds the functionality that does not modify standard language +parsing it should not require clang source code modifications. Most commonly +such extensions add functionality via libraries

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

2021-06-07 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh updated this revision to Diff 350314. svenvh marked an inline comment as done. svenvh retitled this revision from "[OpenCL][Draft] Add OpenCL builtin test generator" to "[OpenCL] Add OpenCL builtin test generator". svenvh added a comment. Improve comments. CHANGES SINCE LAST ACTION htt

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

2021-06-07 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/utils/TableGen/ClangOpenCLBuiltinEmitter.cpp:969 + +void OpenCLBuiltinTestEmitter::getTypeLists( +Record *Type, TypeFlags &Flags, std::vector &TypeList, Anastasia wrote: > I would add a documentation for this fu

[PATCH] D103241: [OpenCL] Add memory_scope_all_devices

2021-06-08 Thread Sven van Haastregt 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 rGd54e7b731e66: [OpenCL] Add memory_scope_all_devices (authored by svenvh). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https:/

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

2021-06-09 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added a comment. 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 already have it on a local branch, so if there is interest (and it seems there is? :-)

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

2021-06-09 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh 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 Should we add `-triple spir`, as

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

2021-06-09 Thread Sven van Haastregt 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 rG8866793b4e0a: [OpenCL] Add OpenCL builtin test generator (authored by svenvh). Herald added a subscriber: ldrumm. Herald added a project: clang. Cha

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

2021-06-10 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. svenvh added reviewers: azabaznov, Anastasia. svenvh added a project: clang. Herald added subscribers: ldrumm, yaxunl. svenvh requested review of this revision. Herald added a subscriber: cfe-commits. Add an emitter to produce something similar to `opencl-c.h` from th

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

2021-06-17 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh accepted this revision. svenvh added a comment. This revision is now accepted and ready to land. LGTM! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D103911/new/ https://reviews.llvm.org/D103911 __

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

2021-06-17 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added a comment. In D104040#2824281 , @Anastasia wrote: > Do you think we could add any test for this yet? Or do we have to wait until > we have other pieces in place for diffing to `opencl-c.h`? We could add a > test for parsing the header but i

[PATCH] D107151: [OpenCL] Reduce duplicate defs by using multiclasses; NFC

2021-07-30 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. svenvh added a reviewer: Anastasia. svenvh added a project: clang. Herald added subscribers: ldrumm, yaxunl. svenvh requested review of this revision. Herald added a subscriber: cfe-commits. Builtin definitions with pointer arguments were duplicated to provide overloa

[PATCH] D106343: [OpenCL] Support cl_ext_float_atomics

2021-08-03 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/lib/Headers/opencl-c-base.h:24 #define cl_khr_subgroup_clustered_reduce 1 +#define cl_ext_float_atomics +#ifdef cl_khr_fp16 Should this be defined as `1`? Should this define be tested in `clang/test/Headers/opencl

[PATCH] D107151: [OpenCL] Reduce duplicate defs by using multiclasses; NFC

2021-08-05 Thread Sven van Haastregt via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG92b00ffe0fb3: [OpenCL] Reduce duplicate defs by using multiclasses; NFC (authored by svenvh). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D107151/new/ http

[PATCH] D106343: [OpenCL] Support cl_ext_float_atomics

2021-08-05 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh requested changes to this revision. svenvh added inline comments. This revision now requires changes to proceed. Comment at: clang/lib/Headers/opencl-c-base.h:24 #define cl_khr_subgroup_clustered_reduce 1 +#define cl_ext_float_atomics +#ifdef cl_khr_fp16

[PATCH] D107769: [OpenCL] Make generic addrspace optional for -fdeclare-opencl-builtins

2021-08-09 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. svenvh added reviewers: Anastasia, airlied, azabaznov. svenvh added a project: clang. Herald added subscribers: ldrumm, yaxunl. svenvh requested review of this revision. Herald added a subscriber: cfe-commits. Currently, -fdeclare-opencl-builtins always adds the gener

[PATCH] D107963: [OpenCL] Fix as_type(vec3) invalid store creation

2021-08-12 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. svenvh added reviewers: Anastasia, jaykang10. svenvh added a project: clang. Herald added subscribers: ldrumm, yaxunl. svenvh requested review of this revision. Herald added a subscriber: cfe-commits. With `-fpreserve-vec3-type` enabled, a cast was not created when co

[PATCH] D106343: [OpenCL] Support cl_ext_float_atomics

2021-08-17 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added a comment. Thanks for the update! I have a few points to improve the patch. Comment at: clang/lib/Sema/OpenCLBuiltins.td:1107 +// The functionality added by cl_ext_float_atomics extension +let MinVersion = CL30 in { + foreach TypePair = Do we rea

[PATCH] D108113: [C++4OpenCL] Enable -cl-std flag clc++21 as a shorthand for clc++2021

2021-08-17 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added a comment. In D108113#2949141 , @Anastasia wrote: > @svenvh I would like to discuss it further with Sven whether it is a good > direction or not? The underlying motivation for adding those aliases seems to be missing from the description.

[PATCH] D108038: [C++4OpenCL] C++ for OpenCL version 2021 introduced to command line

2021-08-17 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh accepted this revision. svenvh added a comment. LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D108038/new/ https://reviews.llvm.org/D108038 ___ cfe-commits mailing list cfe-commits@lists.llvm

[PATCH] D107963: [OpenCL] Fix as_type(vec3) invalid store creation

2021-08-17 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/lib/CodeGen/CGExprScalar.cpp:4789 - -if (!CGF.CGM.getCodeGenOpts().PreserveVec3Type) { - Src = createCastsForTypeOfSameSize(Builder, CGF.CGM.getDataLayout(), Src, Anastasia wrote: > While I agree with this

[PATCH] D107963: [OpenCL] Fix as_type(vec3) invalid store creation

2021-08-17 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/lib/CodeGen/CGExprScalar.cpp:4789 - -if (!CGF.CGM.getCodeGenOpts().PreserveVec3Type) { - Src = createCastsForTypeOfSameSize(Builder, CGF.CGM.getDataLayout(), Src, jaykang10 wrote: > svenvh wrote: > > Anasta

[PATCH] D107963: [OpenCL] Fix as_type(vec3) invalid store creation

2021-08-18 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/lib/CodeGen/CGExprScalar.cpp:4789 - -if (!CGF.CGM.getCodeGenOpts().PreserveVec3Type) { - Src = createCastsForTypeOfSameSize(Builder, CGF.CGM.getDataLayout(), Src, jaykang10 wrote: > svenvh wrote: > > jaykan

[PATCH] D106343: [OpenCL] Support cl_ext_float_atomics

2021-08-18 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/lib/Sema/OpenCLBuiltins.td:1108 + +let Extension = FuncExtFloatAtomics in { + let MinVersion = CL20 in { So now all of those builtins are guarded by `cl_ext_float_atomics`, which is good, but not by any of the `__

[PATCH] D107963: [OpenCL] Fix as_type(vec3) invalid store creation

2021-08-19 Thread Sven van Haastregt via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG7bda1a0711c6: [OpenCL] Fix as_type(vec3) invalid store creation (authored by svenvh). Changed prior to commit: https://reviews.llvm.org/D107963?vs=365993&id=367448#toc Repository: rG LLVM Github Mono

[PATCH] D97072: [OpenCL][Docs] Add guidelines for adding new extensions and features

2021-03-02 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added a comment. LGTM mostly, but would like to hear the opinion of others on the discussion about "useful". Comment at: clang/docs/OpenCLSupport.rst:221 +triggers in the parsing) should not be added to clang. Moreover, the acceptable +behavior of pragmas should provide

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

2021-03-03 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. svenvh added reviewers: Anastasia, azabaznov. Herald added subscribers: jfb, yaxunl. svenvh requested review of this revision. Add a new clang-tblgen flag `-gen-clang-opencl-builtin-tests` that generates a .cl file containing calls to every builtin function defined in

[PATCH] D97930: [OpenCL] Fix builtins that require multiple extensions

2021-03-04 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. svenvh added a reviewer: Anastasia. svenvh added a project: clang. Herald added a subscriber: yaxunl. svenvh requested review of this revision. Herald added a subscriber: cfe-commits. Builtins that require multiple extensions, such as certain `write_imagef` forms, wer

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

2021-03-04 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added a comment. In D97869#2602943 , @Anastasia wrote: > I was just thinking if we could combine the calls into one function to > minimize the number of lines to parse? Perhaps this will make the Tablegen > generator too complex? That will increa

[PATCH] D98039: [OpenCL] Set calling convention for -fdeclare-opencl-builtins

2021-03-05 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. svenvh added a reviewer: Anastasia. svenvh added a project: clang. Herald added a subscriber: yaxunl. svenvh requested review of this revision. Herald added a subscriber: cfe-commits. IR produced using TableGen builtin function declarations (`fdeclare-opencl-builtins.

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

2021-03-05 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added a comment. To be honest, I don't have a concrete picture yet of how to deploy this emitter for testing. So here are a few thoughts about the various options that come to mind: 1. Regenerate the test file every time we run check-clang and use it to validate the `-fdeclare-opencl-b

[PATCH] D97930: [OpenCL] Fix builtins that require multiple extensions

2021-03-05 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh updated this revision to Diff 328549. svenvh added a comment. > You don't seem to be using write_imagef for OpenCL versions <= 1.2. But > should we be checking that the diagnostic is given? Good point, I have updated the test to check for the diagnostic. CHANGES SINCE LAST ACTION http

[PATCH] D97930: [OpenCL] Fix builtins that require multiple extensions

2021-03-09 Thread Sven van Haastregt via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG13c77f204671: [OpenCL] Fix builtins that require multiple extensions (authored by svenvh). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D97930/new/ https://

[PATCH] D98076: [OpenCL][Docs] Release 12.0 notes

2021-03-09 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/docs/ReleaseNotes.rst:208 +- Added ``-cl-std=CL3.0`` and predefined version macro for OpenCL 3.0. +- Added ``-cl-std=CL1.0`` and mapped to the existing OpenCL 1.0 functionality. +- Improved OpenCL extension handling per target. ---

[PATCH] D98039: [OpenCL] Set calling convention for -fdeclare-opencl-builtins

2021-03-10 Thread Sven van Haastregt via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6f912a2cd491: [OpenCL] Set calling convention for -fdeclare-opencl-builtins (authored by svenvh). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D98039/new/ h

[PATCH] D97072: [OpenCL][Docs] Add guidelines for adding new extensions and features

2021-03-10 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh accepted this revision. svenvh added a comment. This revision is now accepted and ready to land. LGTM with the latest elaboration on "useful". It seems you accidentally added unrelated changes to Types.cpp to this review, so please take care not to commit those. CHANGES SINCE LAST ACTI

[PATCH] D96771: [OpenCL] Add distinct file extension for C++ for OpenCL

2021-03-10 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh accepted this revision. svenvh added a comment. This revision is now accepted and ready to land. LGTM, but maybe give this another 24h before landing in case there are any remaining concerns. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D96771/new/ https://reviews.llvm.org/D9677

[PATCH] D98076: [OpenCL][Docs] Release 12.0 notes

2021-03-10 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/docs/ReleaseNotes.rst:214 +- Added ``global_device`` and ``global_host`` address spaces for USM + allocations. + Anastasia wrote: > svenvh wrote: > > Perhaps one more point to mention: > > ``` > > - Allow pointer-

[PATCH] D98076: [OpenCL][Docs] Release 12.0 notes

2021-03-10 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added inline comments. Comment at: clang/docs/ReleaseNotes.rst:214 +- Added ``global_device`` and ``global_host`` address spaces for USM + allocations. + Anastasia wrote: > svenvh wrote: > > Anastasia wrote: > > > svenvh wrote: > > > > Perhaps one more po

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

2021-03-10 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added a comment. In D97869#2616772 , @Anastasia wrote: > Regarding 2 and 4 I think we should drive towards deprecation of `opencl-c.h` > as it is a maintenance overhead but we could convert it into a test instead? Perhaps you misunderstood option

[PATCH] D98076: [OpenCL][Docs] Release 12.0 notes

2021-03-10 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh accepted this revision. svenvh added inline comments. This revision is now accepted and ready to land. Comment at: clang/docs/ReleaseNotes.rst:214 +- Added ``global_device`` and ``global_host`` address spaces for USM + allocations. + Anastasia wrote: > sv

[PATCH] D98418: [OpenCL] Remove mixed signedness atomic_fetch_ from opencl-c.h

2021-03-11 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. svenvh added reviewers: stuart, Anastasia. svenvh added a project: clang. Herald added subscribers: jfb, yaxunl. svenvh requested review of this revision. Herald added a subscriber: cfe-commits. The OpenCL C specification v3.0.6 s6.15.12.7.5 mentions: For atomic_fe

[PATCH] D98076: [OpenCL][Docs] Release 12.0 notes

2021-03-11 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh accepted this revision. svenvh added a comment. In D98076#2619425 , @Anastasia wrote: > Sorry for the last-minute change, I have decided to add this too: > > +- Removed extensions without kernel language changes: > + ``cl_khr_select_fprounding_

[PATCH] D98411: [OpenCL] Respect calling convention for builtin

2021-03-12 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh accepted this revision. svenvh added a comment. In D98411#2621736 , @ldrumm wrote: > @Anastasia @svenvh is this already covered by https://reviews.llvm.org/D98039 > ? D98039 adds the calling convention for OpenCL

[PATCH] D98520: [OpenCL] Remove spurious atomic_fetch tablegen builtins

2021-03-12 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh created this revision. svenvh added a reviewer: Anastasia. svenvh added a project: clang. Herald added subscribers: jfb, yaxunl. svenvh requested review of this revision. Herald added a subscriber: cfe-commits. The `int` and `long` versions of these builtins already provide the necessary ov

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

2021-03-12 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added a comment. In D97058#2622669 , @thakis wrote: > Does it repro if you add `-target arm64-apple-macosx` as arg to c-index-test > on the RUN line of that test? I also had trouble reproducing the failure locally, but by specifying this target I

[PATCH] D112410: [SPIR-V] Add a toolchain for SPIR-V in clang

2021-12-02 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh requested changes to this revision. svenvh added inline comments. This revision now requires changes to proceed. Comment at: clang/lib/Driver/Driver.cpp:3728 + // Linking separate translation units for SPIR-V is not supported yet. + // It can be done either by LLVM IR

[PATCH] D130768: [OpenCL][SPIR-V] Add test for extern functions with a pointer

2022-08-19 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh accepted this revision. svenvh added a comment. LGTM. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130768/new/ https://reviews.llvm.org/D130768 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mai

[PATCH] D132473: [Docs][OpenCL][SPIR-V] Release 15 notes for Clang

2022-08-23 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added a comment. In D132473#3742688 , @Anastasia wrote: > @svenvh as you made quite a lot of changes in the headers feel free to expand > the description if you feel we should document some of those in more detail. I think you have captured it qu

[PATCH] D132473: [Docs][OpenCL][SPIR-V] Release 15 notes for Clang

2022-08-24 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh accepted this revision. svenvh added a comment. This revision is now accepted and ready to land. LGTM, thanks! Comment at: clang/docs/ReleaseNotes.rst:676 + LLVM backend when generating SPIR-V binary. + Floating Point Support in Clang Anastasia wrote:

[PATCH] D134445: [PR57881][OpenCL] Fix incorrect diagnostics with templated types in kernel arguments

2022-09-22 Thread Sven van Haastregt via Phabricator via cfe-commits
svenvh added a comment. > I have attempted to workaround this issue for the reported test cases, > however it still doesn't quite work when the type is created from the > template parameter (see FIXME test case in the patch). I presume we want to > allow this? If so we might need to disable laz

<    1   2   3   4   5   >