[PATCH] D156743: clang/OpenCL: Add inline implementations of sqrt in builtin header

2023-09-12 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. This revision is now accepted and ready to land. If we think there are no better alternatives and implementation is generic enough for every vendor, LGTM! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D156743/new/ https://revi

[PATCH] D155978: [SPIRV] Add SPIR-V logical triple.

2023-08-11 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: llvm/unittests/TargetParser/TripleTest.cpp:1307 + EXPECT_TRUE(T.isSPIRV()); + T.setArch(Triple::spirv32); pmatos wrote: > Keenuts wrote: > > pmatos wrote: > > > I am not well-versed in SPIRV for gfx but if we are u

[PATCH] D156743: clang/OpenCL: Add inline implementations of sqrt in builtin header

2023-08-04 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/Headers/opencl-c-base.h:832 + +inline float __ovld __cnfn sqrt(float __x) { + return __builtin_elementwise_sqrt(__x); arsenm wrote: > svenvh wrote: > > Anastasia wrote: > > > Is this a generic implementation

[PATCH] D156743: clang/OpenCL: Add inline implementations of sqrt in builtin header

2023-08-01 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/Headers/opencl-c-base.h:832 + +inline float __ovld __cnfn sqrt(float __x) { + return __builtin_elementwise_sqrt(__x); Is this a generic implementation enough? Would some targets not need to do something dif

[PATCH] D156816: [Clang] Make generic aliases to OpenCL address spaces

2023-08-01 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. > We also are tied to OpenCL semantic of future versions. This is what I would like to avoid aliasing to OpenCL and then starting to change it in a way that is not conforming or documented. Maybe there is a need for something like an address space for the group of rel

[PATCH] D156816: [Clang] Make generic aliases to OpenCL address spaces

2023-08-01 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D156816#4551357 , @jhuber6 wrote: > In D156816#4551338 , @yaxunl wrote: > >>> FFI isn't the reason you'd use these, it's for generic access to the actual >>> backend. E.g. an `addrsp

[PATCH] D151339: [OpenCL] Add cl_ext_image_raw10_raw12 extension

2023-06-04 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. This revision is now accepted and ready to land. LGTM! Thanks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D151339/new/ https://reviews.llvm.org/D151339 _

[PATCH] D151087: [Clang] Permit address space casts with 'reinterpret_cast' in C++

2023-05-22 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. I don't feel `reinterpret_cast` is the right fit for this as it's expected to do just reinterpretation but `addrspacecast` LLVM instruction which Clang generates might result in some more operations in particular some special instructions for address calculation. Woul

[PATCH] D143849: [Clang][OpenCL] Allow pointers in structs as kernel arguments from 2.0

2023-03-12 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. This revision is now accepted and ready to land. LGTM! Thanks CHANGES SINCE LAST ACTION https://reviews.llvm.org/D143849/new/ https://reviews.llvm.org/D143849 ___ cfe-commits mailing list

[PATCH] D141008: [Clang][SPIR-V] Emit target extension types for OpenCL types on SPIR-V.

2023-03-12 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. This revision is now accepted and ready to land. LGTM! Thanks Comment at: clang/lib/CodeGen/TargetInfo.h:383 + + /// Return an LLVM target extension type that corresponds to an OpenCL type, + /// if such a type is n

[PATCH] D143348: [Clang][Doc][OpenCL] Release 16 notes

2023-02-19 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia closed this revision. Anastasia added a comment. Committed in https://github.com/llvm/llvm-project/commit/639db8a90d2adf7789b9d3cec3a7c26502bf819b CHANGES SINCE LAST ACTION https://reviews.llvm.org/D143348/new/ https://reviews.llvm.org/D143348 _

[PATCH] D143849: [Clang][OpenCL] Allow pointers in structs as kernel arguments from 2.0

2023-02-19 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:9494 + // of SVM. + if (S.getLangOpts().getOpenCLCompatibleVersion() > 120 && + (ParamType == PtrKernelParam || ParamType == PtrPtrKernelParam)) Ayal wrote: > Anastasia wr

[PATCH] D143849: [Clang][OpenCL] Allow pointers in structs as kernel arguments from 2.0

2023-02-15 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:9494 + // of SVM. + if (S.getLangOpts().getOpenCLCompatibleVersion() > 120 && + (ParamType == PtrKernelParam || ParamType == PtrPtrKernelParam)) Anastasia wrote: > Ayal wr

[PATCH] D143849: [Clang][OpenCL] Allow pointers in structs as kernel arguments from 2.0

2023-02-13 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/Sema/SemaDecl.cpp:9494 + // of SVM. + if (S.getLangOpts().getOpenCLCompatibleVersion() > 120 && + (ParamType == PtrKernelParam || ParamType == PtrPtrKernelParam)) Ayal wrote: > Anastasia wr

[PATCH] D143348: [Clang][Doc][OpenCL] Release 16 notes

2023-02-12 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/docs/ReleaseNotes.rst:840 + * Fixed conditional definition of the depth image and read_write image3d builtins. + * Added ``nounwind`` attribute to all builtin functions. + svenvh wrote: > It's slightly more th

[PATCH] D143348: [Clang][Doc][OpenCL] Release 16 notes

2023-02-12 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 496790. Anastasia added a comment. Updated bullet about nounwind attr CHANGES SINCE LAST ACTION https://reviews.llvm.org/D143348/new/ https://reviews.llvm.org/D143348 Files: clang/docs/ReleaseNotes.rst Index: clang/docs/ReleaseNotes.rst ===

[PATCH] D143849: [Clang][OpenCL] Allow pointers in structs as kernel arguments from 2.0

2023-02-12 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. I feel that originally pointers were disallowed because they create the same issue as `size_t` and etc as their size is implementation depended but the same logic applies to images and other types that are even more implementation depended. Overall this bit of the spe

[PATCH] D143472: [clang] Cast the pointer to right type with different address space

2023-02-12 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/CodeGen/CGBuiltin.cpp:12412 // Cast the pointer to right type. - Value *Ptr = CGF.Builder.CreateBitCast(Ops[0], - llvm::PointerType::getUnqual(Ops[1]->getType())); + Value *Ptr = CGF.Builde

[PATCH] D141008: [Clang][SPIR-V] Emit target extension types for OpenCL types on SPIR-V.

2023-02-12 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/CodeGen/CGOpenCLRuntime.cpp:40 switch (cast(T)->getKind()) { default: I am not sure if this can be called a generic implementation as it has always been a workaround to compensate for absence of repr

[PATCH] D143348: [Clang][Doc][OpenCL] Release 16 notes

2023-02-05 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. Anastasia added a reviewer: svenvh. Herald added subscribers: Naghasan, ebevhan, yaxunl. Herald added a project: All. Anastasia requested review of this revision. Documented major OpenCL features in release 16. https://reviews.llvm.org/D143348 Files: clang/doc

[PATCH] D142948: [OpenCL] Disable vector to scalar types coercion for OpenCL

2023-02-03 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. It doesn't seem to make sense to have a `LangOpt` for this, if anything a new `CodeGenOpt` feels like a better fit. Then you should probably extend existing classify functions to prevent coercion instead of adding yet another function otherwise you will need to handle

[PATCH] D141620: clang/OpenCL: Apply default attributes to enqueued blocks

2023-01-15 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/test/CodeGenOpenCL/cl20-device-side-enqueue-attributes.cl:26 +// SPIR32-SAME: (ptr addrspace(1) align 4 [[A:%.*]], ptr addrspace(1) align 4 [[B:%.*]], i32 [[I:%.*]]) #[[ATTR0:[0-9]+]] !kernel_arg_addr_space !2 !kernel_arg_acces

[PATCH] D141700: AMDGPU: Move enqueued block handling into clang

2023-01-15 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/CodeGen/TargetInfo.cpp:12440 +/// AMDHSAKernelDescriptor.h) +static llvm::StructType *getKernelDescriptorType(llvm::LLVMContext &C) { + llvm::Type *Int8 = llvm::IntegerType::getInt8Ty(C); Is this AMDGPU targ

[PATCH] D141297: [OpenCL] Allow undefining header-only features

2023-01-15 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D141297#4047148 , @svenvh wrote: > In D141297#4043122 , @Anastasia > wrote: > >> Btw I wonder if in the future we could add some error or warning in case >> someone uses the same ap

[PATCH] D141449: clang/OpenCL: Fix not setting convergent on block invoke kernels

2023-01-11 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/CodeGen/TargetInfo.cpp:12426 // FIXME: Apply default attributes F->addFnAttr(llvm::Attribute::NoUnwind); If `ConstructDefaultFnAttrList` was used it would get convergent correctly... Should we be usi

[PATCH] D141297: [OpenCL] Allow undefining header-only features

2023-01-11 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. This revision is now accepted and ready to land. LGTM, thanks! Btw I wonder if in the future we could add some error or warning in case someone uses the same approach for frontend specific features, i.e. #ifdef __undef___opencl_c_ge

[PATCH] D141008: [Clang][SPIR-V] Emit target extension types for OpenCL types on SPIR-V.

2023-01-11 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/CodeGen/CGExprScalar.cpp:2260 -return CGF.CGM.getNullPointer(cast(ConvertType(DestTy)), - DestTy); +// The type may be a target extension type instead of a pointer type +// (e.g., Op

[PATCH] D141008: [Clang][SPIR-V] Emit target extension types for OpenCL types on SPIR-V.

2023-01-06 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. Can you link relevant LLVM reviews or documentation and perhaps add some more details into the description? It's a bit suboptimal though to emit this form of types as SPIR-V specific. Ideally Clang should worry as less as possible about target specifics. So it woul

[PATCH] D137652: Remove mandatory define of optional features macros for OpenCL C 3.0

2022-12-02 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D137652#3957519 , @svenvh wrote: >> @svenvh I remember that we have also discussed the addition of a vendor >> specific header where such feature/extension macro definition can be added >> to avoid the macro pollution but I

[PATCH] D137652: Remove mandatory define of optional features macros for OpenCL C 3.0

2022-11-29 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D137652#3957233 , @FMarno wrote: > @Anastasia I feel like I am following the guidance you quoted here. The > defines I've deleted in `opencl-c-base.h` are blocking the possibility of > `-cl-ext` working and would also get i

[PATCH] D137652: Remove mandatory define of optional features macros for OpenCL C 3.0

2022-11-29 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. Are these features affecting the frontend functionality in any way? If not we should implement those in the headers and if headers are not flexible enough to condition out the addition of the new macros we should extend them (potentially by extending behaviour of `-cl

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

2022-11-11 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D134445#3920448 , @rjmccall wrote: > In D134445#3920257 , @Anastasia > wrote: > >> In D134445#3920188 , @rjmccall >> wrote: >> >>> You real

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

2022-11-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D134445#3920188 , @rjmccall wrote: > You really can't ask whether a class template pattern is standard layout; > it's not meaningful. Well the templates have to be instantiated with concrete types as kernels can't be calle

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

2022-11-10 Thread Anastasia Stulova 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 rG790cbaafc9e2: [OpenCL] Fix diagnostics with templates in kernel args. (authored by Anastasia). Herald added a subscriber: ldrumm. Herald added a proj

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

2022-10-25 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 470458. Anastasia added a comment. Addressed review comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D134445/new/ https://reviews.llvm.org/D134445 Files: clang/lib/Sema/SemaDecl.cpp clang/test/SemaOpenCLCXX/invalid-kernel.clcpp Index:

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

2022-09-22 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/test/SemaOpenCLCXX/invalid-kernel.clcpp:110 + +// FIXME: Use of templates doesn't work due to lazy instantiation of reference types. +//template I think here should be something like - `the use of templated typ

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

2022-09-22 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. Anastasia added reviewers: svenvh, olestrohm, rjmccall. Herald added subscribers: Naghasan, ebevhan, yaxunl. Herald added a project: All. Anastasia requested review of this revision. It seems relying on `isStandardLayoutType` helpers is fragile when kernel argumen

[PATCH] D132056: [HLSL] Restrict to supported targets

2022-09-02 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. This makes sense. I believe the same applies to some other languages i.e. OpenCL, as the way clang evolved currently not all targets are compatible with all languages. In the future we might want to generalize this diagnostics to use

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

2022-09-01 Thread Anastasia Stulova via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6b1a04529c8f: [OpenCL][SPIR-V] Test extern functions with a pointer arg. (authored by Anastasia). Herald added a subscriber: ldrumm. Herald added a project: clang. Changed prior to commit: https://revie

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

2022-09-01 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia closed this revision. Anastasia added a comment. Committed in https://github.com/llvm/llvm-project/commit/5e1b36ced538cfc80f2400b27e346d2175b04092. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132473/new/ https://reviews.llvm.org/D132473

[PATCH] D116266: [SPIR-V] Add linking of separate translation units using spirv-link

2022-08-31 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Herald added a subscriber: MaskRay. Herald added a project: All. Comment at: clang/docs/UsersManual.rst:3602 +Linking is done using ``spirv-link`` from `the SPIRV-Tools project +`_. Similar to

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

2022-08-24 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/docs/ReleaseNotes.rst:676 + LLVM backend when generating SPIR-V binary. + Floating Point Support in Clang svenvh wrote: > Should we say anything about opaque pointers? Something like: > > ``` > - Although LL

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

2022-08-24 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 455139. Anastasia added a comment. - Added clarification about the opaque pointers in SPIR-V. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132473/new/ https://reviews.llvm.org/D132473 Files: clang/docs/ReleaseNotes.rst Index: clang/docs/Rele

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

2022-08-23 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 454838. Anastasia added a comment. Minor formatting changes CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132473/new/ https://reviews.llvm.org/D132473 Files: clang/docs/ReleaseNotes.rst Index: clang/docs/ReleaseNotes.rst =

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

2022-08-23 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. @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. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D132473/new/ https://reviews.llvm.org/D132473

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

2022-08-23 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. Anastasia added a reviewer: svenvh. Herald added subscribers: ebevhan, yaxunl. Herald added a project: All. Anastasia requested review of this revision. Added list of functional changes to release notes. https://reviews.llvm.org/D132473 Files: clang/docs/Relea

[PATCH] D130951: [HLSL] CodeGen hlsl resource binding.

2022-08-03 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.h:46 public: + struct ResBinding { +llvm::Optional Reg; Does this apply to buffers only? In which case it might be better to either nest this into Buffer definition or rename into

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

2022-07-29 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. Anastasia added reviewers: svenvh, iliya-diyachkov. Herald added subscribers: ebevhan, yaxunl. Herald added a project: All. Anastasia requested review of this revision. I would like to add this test case that enhances coverage of opaque pointers particularly for t

[PATCH] D130766: [SPIR-V] Disable opaque pointers in relese 15

2022-07-29 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a subscriber: linjamaki. Anastasia added a comment. CC to @linjamaki in case there is anything else/different needed for HIP. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D130766/new/ https://reviews.llvm.org/D130766 ___ cfe-c

[PATCH] D130766: [SPIR-V] Disable opaque pointers in relese 15

2022-07-29 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. Anastasia added reviewers: svenvh, iliya-diyachkov. Herald added a subscriber: ebevhan. Herald added a project: All. Anastasia requested review of this revision. Herald added a subscriber: MaskRay. As discussed on RFC mapping into SPIR-V requires pointer being pres

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-07-29 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:61 + +GlobalVariable *replaceCBuffer(CGHLSLRuntime::CBuffer &CB) { + const unsigned CBufferAddressSpace = 4; python3kgae wrote: > Anastasia wrote: > > I don't think I understand the

[PATCH] D130131: [HLSL] CodeGen hlsl cbuffer/tbuffer.

2022-07-27 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:61 + +GlobalVariable *replaceCBuffer(CGHLSLRuntime::CBuffer &CB) { + const unsigned CBufferAddressSpace = 4; I don't think I understand the intent of this function along with `CGHL

[PATCH] D128436: [OpenCL] Remove fast_ half geometric builtins

2022-06-24 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. This revision is now accepted and ready to land. LGTM! Thanks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128436/new/ https://reviews.llvm.org/D128436 _

[PATCH] D128434: [OpenCL] Remove half scalar vload/vstore builtins

2022-06-24 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. This revision is now accepted and ready to land. LGTM! Thanks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D128434/new/ https://reviews.llvm.org/D128434 _

[PATCH] D127579: [clang][WIP] add option to keep types of ptr args for non-kernel functions in metadata

2022-06-24 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D127579#3598308 , @nikic wrote: > In D127579#3598306 , @Anastasia > wrote: > >> In D127579#3595461 , @nikic wrote: >> >>> In D127579#3588626

[PATCH] D127961: [OpenCL] Reduce emitting candidate notes for builtins

2022-06-21 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. This revision is now accepted and ready to land. LGTM! Thanks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D127961/new/ https://reviews.llvm.org/D127961 _

[PATCH] D128012: [HLSL] Add ExternalSemaSource & vector alias

2022-06-21 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D128012#3592126 , @beanz wrote: > In D128012#3592098 , @Anastasia > wrote: > >> aha, are you having a lot of these types then? Ok that sounds similar >> problem to OpenCL builtin fu

[PATCH] D127579: [clang][WIP] add option to keep types of ptr args for non-kernel functions in metadata

2022-06-21 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D127579#3595461 , @nikic wrote: > In D127579#3588626 , @Anastasia > wrote: > >> In D127579#3586092 , @nikic wrote: >> >>> @Anastasia Thanks,

[PATCH] D127579: [clang][WIP] add option to keep types of ptr args for non-kernel functions in metadata

2022-06-17 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. Btw do we have any issue tracking this failure, I am having a feeling that the translation of special types might be related to https://github.com/llvm/llvm-project/issues/55121? I am not aware at which point libclc is expected to be linked for SPIR-V but if linking h

[PATCH] D128012: [HLSL] Add ExternalSemaSource & vector alias

2022-06-17 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D128012#3591828 , @beanz wrote: > For just the type alias, adding it during parsing would probably work. Where > things get more complicated is we have a whole mess of other data types that > we’ll need to add too eventuall

[PATCH] D128012: [HLSL] Add ExternalSemaSource & vector alias

2022-06-17 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. I wonder if accepting type alias with identifier `vector` while parsing would be simpler to implement? Then you could just add those type aliases into the internal header. I assume user code is not allowed to redefine those i.e. it would result in undefined behavior o

[PATCH] D127961: [OpenCL] Reduce emitting candidate notes for builtins

2022-06-17 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/Sema/SemaOverload.cpp:11224 + // so do not generate such notes. + if (S.getLangOpts().OpenCL && Fn->isImplicit() && + Cand->FailureKind != ovl_fail_bad_conversion) It would have been nice to print each

[PATCH] D127579: [clang][WIP] add option to keep types of ptr args for non-kernel functions in metadata

2022-06-17 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D127579#3585537 , @nikic wrote: > In D127579#3585516 , @beanz wrote: > >> > > Clang is only permitted to encode pointer type information if that pointer > type has some kind of dire

[PATCH] D127579: [clang][WIP] add option to keep types of ptr args for non-kernel functions in metadata

2022-06-17 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D127579#3590632 , @aeubanks wrote: > If I'm understanding correctly, previously the LLVM pointee type was used to > represent a frontend OpenCL type. An alternative to marking everything with > `elementtype` or adding metad

[PATCH] D127579: [clang][WIP] add option to keep types of ptr args for non-kernel functions in metadata

2022-06-16 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D127579#3588651 , @bader wrote: >> The way I understand a bitcast instruction in SPIR-V (`OpBitcast` in >> https://www.khronos.org/registry/SPIR-V/specs/unified1/SPIRV.html#_conversion_instructions) >> is that it can only a

[PATCH] D127579: [clang][WIP] add option to keep types of ptr args for non-kernel functions in metadata

2022-06-16 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D127579#3586092 , @nikic wrote: > @Anastasia Thanks, that does sound like a legitimate reason to include the > information. I want to double check though, does linking the modules actually > fail if the functions have signa

[PATCH] D127579: [clang][WIP] add option to keep types of ptr args for non-kernel functions in metadata

2022-06-15 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D127579#3585537 , @nikic wrote: > In D127579#3585516 , @beanz wrote: > >> @nikic the most important thing you need to know about SPIR-V is that it is >> a virtual ISA based on LLVM I

[PATCH] D127579: [clang][WIP] add option to keep types of ptr args for non-kernel functions in metadata

2022-06-15 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. The patch seems very straight forward. I wonder though if we should always enable this for SPIR-V w/o adding any flag until the untyped pointers are added to SPIR-V so it will become a target setting controlled instead of a flag? Also is there anything that we don't

[PATCH] D126857: [HLSL] Add WaveActiveCountBits as Langugage builtin function for HLSL

2022-06-02 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. This revision is now accepted and ready to land. LGTM! Thanks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126857/new/ https://reviews.llvm.org/D126857 _

[PATCH] D126857: [HLSL] Add WaveActiveCountBits as Langugage builtin function for HLSL

2022-06-02 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/include/clang/Basic/Builtins.def:1697 +// HLSL +LANGBUILTIN(WaveActiveCountBits, "Uib", "nc", HLSL_LANG) + python3kgae wrote: > Anastasia wrote: > > FYI we most of time try to add a builtin name using a reserved

[PATCH] D126857: [HLSL] Add WaveActiveCountBits as Langugage builtin function for HLSL

2022-06-02 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/include/clang/Basic/Builtins.def:1697 +// HLSL +LANGBUILTIN(WaveActiveCountBits, "Uib", "nc", HLSL_LANG) + FYI we most of time try to add a builtin name using a reserved identifier which is not part of the langu

[PATCH] D126857: [HLSL] Add WaveActiveCountBits as Langugage builtin function for HLSL

2022-06-02 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. ok, so the reason you are adding this to clang is that it needs to be mapped into a target intrinsic? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D126857/new/ https://reviews.llvm.org/D126857 __

[PATCH] D124753: [HLSL] Set main as default entry.

2022-06-02 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D124753#3550670 , @python3kgae wrote: > In D124753#3550337 , @Anastasia > wrote: > >> In D124753#3546608 , @python3kgae >> wrote: >> >>> I

[PATCH] D126660: [OpenCL] Reword unknown extension pragma diagnostic

2022-06-01 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. This revision is now accepted and ready to land. Ok, makes sense! Thanks! Btw I was thinking we should provide some way for developers to know what extensions are being supported either through documentation or by querying clang someh

[PATCH] D124752: [HLSL] clang codeGen for HLSLShaderAttr.

2022-06-01 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. This revision is now accepted and ready to land. LGTM! Thanks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124752/new/ https://reviews.llvm.org/D124752 _

[PATCH] D124753: [HLSL] Set main as default entry.

2022-06-01 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D124753#3546608 , @python3kgae wrote: > In D124753#3545779 , @Anastasia > wrote: > >> From the current change it seems to me that what you need to be testing is a >> just that the

[PATCH] D125052: [HLSL] Enable vector types for hlsl.

2022-05-30 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. This revision is now accepted and ready to land. LGTM! Thanks Please make sure to reflect in your commit message that you are adding the clang internal headers too. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION h

[PATCH] D124753: [HLSL] Set main as default entry.

2022-05-30 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. From the current change it seems to me that what you need to be testing is a just that the frontend options are being passed correctly? This should then be a driver test with `-###` checking for the options to be set for the frontend invocation... Repository: rG L

[PATCH] D124752: [HLSL] clang codeGen for HLSLShaderAttr.

2022-05-30 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/CodeGen/CGCall.cpp:2606 + if (getLangOpts().HLSL && TargetDecl) { +if (const FunctionDecl *FD = dyn_cast_or_null(TargetDecl)) + getHLSLRuntime().addHLSLFunctionAttributes(FuncAttrs, RetAttrs, FD); I

[PATCH] D124752: [HLSL] clang codeGen for HLSLShaderAttr.

2022-05-26 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/test/CodeGenHLSL/entry.hlsl:1 +// RUN: %clang --driver-mode=dxc -Tcs_6_1 -Efoo -fcgl -Fo - %s | FileCheck %s + Is this test here accidental? Comment at: clang/test/CodeGenHLSL/shader_type_attr.

[PATCH] D124752: [HLSL] clang codeGen for HLSLShaderAttr.

2022-05-26 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/CodeGen/CGHLSLRuntime.cpp:54 + +void clang::CodeGen::CGHLSLRuntime::setHLSLFnuctionAttributes( +llvm::Function *F, const FunctionDecl *FD) { I don't think you need `clang::CodeGen::`? C

[PATCH] D124753: [HLSL] Set main as default entry.

2022-05-26 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/test/CodeGenHLSL/entry_default.hlsl:1 +// RUN: %clang --driver-mode=dxc -Tcs_6_1 -fcgl -Fo - %s | FileCheck %s + Would it make sense to test the opposite i.e. if `-E` is passed in the command line `main` is not

[PATCH] D125052: [HLSL] Enable vector types for hlsl.

2022-05-26 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:3490 + if (!Args.hasArg(options::OPT_dxc_no_stdinc)) +CmdArgs.push_back("-finclude-default-header"); } Sharing command line options is great, let's just update the help messa

[PATCH] D125679: [Clang] Added options for integrated backend only used for SPIR-V for now

2022-05-25 Thread Anastasia Stulova via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG730dc4e9bce8: [Clang] Added options for integrated backend. (authored by Anastasia). Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D125679?vs=429676&id=431938#toc Rep

[PATCH] D125052: [HLSL] Enable vector types for hlsl.

2022-05-24 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/Basic/LangOptions.cpp:122 + if (Opts.HLSL) +Includes.push_back("hlsl.h"); Is this header expected to be large? You might want to flag up in the description of the review and the comments in the header

[PATCH] D124753: [HLSL] Set main as default entry.

2022-05-24 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/Driver/ToolChains/HLSL.cpp:182 } + // If not set entry, default is main. + if (!DAL->hasArg(options::OPT_hlsl_entrypoint)) { -> `If no set entry` or `If entry is not set explicitly` Repository: rG LL

[PATCH] D124752: [HLSL] clang codeGen for HLSLShaderAttr.

2022-05-24 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/lib/AST/Mangle.cpp:138 + // HLSL shader entry function never need to be mangled. + if (getASTContext().getLangOpts().HLSL && D->hasAttr()) Does HLSL shader entry inherits the same behavior as C-linkage functi

[PATCH] D125243: [OpenCL] Make -cl-ext a driver option

2022-05-24 Thread Anastasia Stulova via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd61ded1034bb: [OpenCL] Make -cl-ext a driver option. (authored by Anastasia). Herald added a subscriber: ldrumm. Herald added a project: clang. Changed prior to commit: https://reviews.llvm.org/D125243?

[PATCH] D124776: [SPIR-V] Allow setting SPIR-V version via target triple

2022-05-23 Thread Anastasia Stulova 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 rG72832efc941a: [SPIR-V] Allow setting SPIR-V version via target triple. (authored by Anastasia). Changed prior to commit: https://reviews.llvm.org/

[PATCH] D124382: [Clang] Recognize target address space in superset calculation

2022-05-18 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia requested changes to this revision. Anastasia added a comment. This revision now requires changes to proceed. I feel that to progress further on this change, it would be good to get details about the use cases and the limitations first. However, if there is sufficient evidence of the n

[PATCH] D124382: [Clang] Recognize target address space in superset calculation

2022-05-18 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D124382#3496417 , @jchlanda wrote: > In D124382#3480600 , @Anastasia > wrote: > >> > > > >> And I think we could add this feature in a very light way for example by >> reserving th

[PATCH] D110685: [HIPSPV][4/4] Add option to use llc to emit SPIR-V

2022-05-16 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. Actually after some more thinking I have decided to go for a generic flag and I have created the review for it: https://reviews.llvm.org/D125679. Perhaps you can built your functionality on top of it when you get to it. Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D124776: [SPIR-V] Allow setting SPIR-V version via target triple

2022-05-16 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 429678. Anastasia added a comment. Fixed typo in docs CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124776/new/ https://reviews.llvm.org/D124776 Files: llvm/docs/SPIRVUsage.rst llvm/docs/UserGuides.rst llvm/include/llvm/ADT/Triple.h llvm/

[PATCH] D125679: [Clang] Added options for integrated backend only used for SPIR-V for now

2022-05-16 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. Anastasia added reviewers: mpaszkowski, iliya-diyachkov, svenvh, linjamaki. Herald added subscribers: ThomasRaoux, ebevhan. Herald added a project: All. Anastasia requested review of this revision. Herald added a subscriber: MaskRay. Following the new flow for exte

[PATCH] D125208: [OpenCL] Fix __remove_address_space documentation code example

2022-05-16 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. This revision is now accepted and ready to land. LGTM! Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125208/new/ https://reviews.llvm.org/D125208

[PATCH] D125401: [OpenCL] Do not guard vload/store_half builtins

2022-05-16 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. This revision is now accepted and ready to land. LGTM! Thanks CHANGES SINCE LAST ACTION https://reviews.llvm.org/D125401/new/ https://reviews.llvm.org/D125401 ___ cfe-commits mailing list

[PATCH] D125243: [OpenCL] Make -cl-ext a driver option

2022-05-16 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: clang/docs/UsersManual.rst:3145-3146 + +Note that some targets e.g. SPIR/SPIR-V enable all extensions/features in clang by +default. + svenvh wrote: > Was this meant to go after the command example? true, will fix thi

[PATCH] D124776: [SPIR-V] Allow setting SPIR-V version via target triple

2022-05-09 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 428118. Anastasia added a comment. - Added v1.5. - Changed wording in documentation. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D124776/new/ https://reviews.llvm.org/D124776 Files: llvm/docs/SPIRVUsage.rst llvm/docs/UserGuides.rst llvm/in

[PATCH] D125243: [OpenCL] Make -cl-ext a driver option

2022-05-09 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. Anastasia added a reviewer: svenvh. Herald added subscribers: Naghasan, ebevhan, yaxunl. Herald added a project: All. Anastasia requested review of this revision. Herald added a subscriber: MaskRay. For generic targets such as SPIR-V clang sets all OpenCL extension

[PATCH] D124776: [SPIR-V] Allow setting SPIR-V version via target triple

2022-05-09 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D124776#3497689 , @iliya-diyachkov wrote: > @Anastasia, when are you going to add support for v1.5? We would use it in > the SPIR-V backend. Ok, I can add it straight away if there is a use-case. So far I have taken the l

  1   2   3   4   5   6   7   8   9   10   >