[PATCH] D73360: [OpenCL] Restrict address space conversions in nested pointers

2020-01-30 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia marked an inline comment as done. Anastasia added inline comments. Comment at: clang/test/SemaOpenCL/address-spaces-conversions-cl2.0.cl:521 +#else +// expected-error@-5 {{assigning to '__generic int *__generic *' from incompatible type '__local int *__local *__private

[PATCH] D73360: [OpenCL] Restrict address space conversions in nested pointers

2020-01-31 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In D73360#1850001 , @rjmccall wrote: > Is there no follow-up code when actually emitting the failure diagnostic > which tries to figure out a more specific cause of failure? After looking at this a bit more it seems C++ part c

[PATCH] D45363: [OpenCL] Added -std/-cl-std=CL2.2/CLC++

2018-04-06 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. Anastasia added reviewers: rjmccall, bader, yaxunl. Added std option for OpenCL C++, see cfe-dev thread for more details: http://lists.llvm.org/pipermail/cfe-dev/2018-April/057535.html Examples: `clang -std=CL2.2 test.cl` `clang -std=cl2.2 test.cl` `clang -std=CLC

[PATCH] D45363: [OpenCL] Added -std/-cl-std=CL2.2/CLC++

2018-04-11 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 141975. Anastasia edited the summary of this revision. Anastasia added a comment. Changed to `-cl-std=c++` since it's explicitly defined in spec. We could reuse `OpenCLVersion` in `LangOpts` but I think it might be cleaner to add separate `OpenCLCPlusPlusV

[PATCH] D45363: [OpenCL] Added -std/-cl-std=CL2.2/CLC++

2018-04-11 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Frontend/InitPreprocessor.cpp:434 +llvm_unreachable("Unsupported OpenCL C++ version"); + Builder.defineMacro("__CL_CPP_VERSION_1_0__", "100"); +} else { There is no such macro in the spec it seems,

[PATCH] D39936: [OpenCL] Add extensions cl_intel_subgroups and cl_intel_subgroups_short

2017-11-13 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Headers/opencl-c.h:16128 +#define intel_sub_group_block_read_uiintel_sub_group_block_read +#define intel_sub_group_block_read_ui2 intel_sub_group_block_read2 +#define intel_sub_group_block_read_ui4 intel_sub_group_block_rea

[PATCH] D39784: OpenCL: Assume inline asm is convergent

2017-11-13 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! https://reviews.llvm.org/D39784 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinf

[PATCH] D39129: [OpenCL] Fix generation of constant address space sampler in function scope

2017-11-13 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D39129#902848, @bader wrote: > @Anastasia, during the discussion of similar fix > (https://reviews.llvm.org/D34342). > > I found another bug in the CodeGen library. Do you have time to fix it too? > Here is the reproducer from the old revie

[PATCH] D39129: [OpenCL] Fix generation of constant address space sampler in function scope

2017-11-14 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D39129#924425, @bader wrote: > In https://reviews.llvm.org/D39129#923235, @Anastasia wrote: > > > In https://reviews.llvm.org/D39129#902848, @bader wrote: > > > > > @Anastasia, during the discussion of similar fix > > > (https://reviews.llvm

[PATCH] D34342: [OpenCL] Fix code generation of function-scope constant samplers.

2017-11-14 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. LGTM! Thanks! https://reviews.llvm.org/D34342 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D33989: [OpenCL] Allow targets to select address space per type

2017-11-17 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. Perhaps, I don't understand the concept of layered design in this particular case. But I just find it annoying that we need to re-implement the entire OpenCL AST Type structure in Basic. And even if we don't have dependencies on the files physically we still logically

[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] 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] 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] 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] 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] 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] 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] 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] 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] 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] 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-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] 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] D27569: [OpenCL] Enabling the usage of CLK_NULL_QUEUE as compare operand.

2016-12-15 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaOverload.cpp:1784 FromType = ToType; + } else if (ToType->isQueueT() && + From->isIntegerConstantExpr(S.getASTContext()) && Is this covered with testing? I have a feeling we might need a

[PATCH] D21698: [OpenCL] Allow disabling types and declarations associated with extensions

2016-12-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! Small nitpicks below can be done before committing. Also it would be nice to double check the compile time is still fine after the last rebase. Thanks! Comment

[PATCH] D27569: [OpenCL] Enabling the usage of CLK_NULL_QUEUE as compare operand.

2016-12-16 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: test/SemaOpenCL/queue_t_overload.cl:10 + foo(0, src2); + foo(q, src3); // expected-error {{call to 'foo' is ambiguous}} +} could we also add something non-convertible for queue i.e. foo(1, src3); https://reviews.

[PATCH] D27569: [OpenCL] Enabling the usage of CLK_NULL_QUEUE as compare operand.

2016-12-19 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! https://reviews.llvm.org/D27569 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

[PATCH] D28048: [OpenCL] Align fake address space map with the SPIR target maps.

2016-12-22 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a subscriber: pekka.jaaskelainen. Anastasia added a comment. I believe it's not that important what those numbers actually are, but having the consistency with SPIR might be better indeed at least even for documentation purposes! @pekka.jaaskelainen, I think you are using x86 ta

[PATCH] D27981: Fix problems in "[OpenCL] Enabling the usage of CLK_NULL_QUEUE as compare operand."

2016-12-22 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! If you checked there are no warnings any more, it seems fine to commit! :) https://reviews.llvm.org/D27981 ___ cfe-commits mailing li

[PATCH] D28080: [Docs][OpenCL] Added OpenCL feature description to user manual.

2016-12-23 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. Anastasia added reviewers: yaxunl, pekka.jaaskelainen, bader. Anastasia added subscribers: cfe-commits, rsmith. Adding information on OpenCL to Clang documentation. This currently contain the main features only. I am hoping we can improve it with time documenting

[PATCH] D27917: [OpenCL] Improve diagnostics for double type

2016-12-23 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: test/SemaOpenCL/unknown_type.cl:1 +// RUN: %clang_cc1 -cl-std=CL1.1 -fsyntax-only -verify %s +typedef double double2 __attribute__((ext_vector_type(2))); // expected-error {{use of type 'double' requires cl_khr_fp64 extension to be

[PATCH] D28048: [OpenCL] Align fake address space map with the SPIR target maps.

2016-12-23 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. Excellent! Thanks! https://reviews.llvm.org/D28048 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D28058: [OpenCL] Correct ndrange_t implementation

2016-12-23 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/CodeGen/CGBuiltin.cpp:2491 +llvm::Value *Range = NDRangeL.getAddress().getPointer(); +llvm::Type *RangeTy = NDRangeL.getAddress().getType(); I think following standard Clang CodeGen convention we should a

[PATCH] D28136: [OpenCL] Implement as_type operator as alias of __builtin_astype.

2017-01-03 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. This has been discussed during the initial review for the header: http://lists.llvm.org/pipermail/cfe-commits/Week-of-Mon-20160425/157187.html The main issue is after preprocessing the header the original function name is no longer available in diagnostics reported. Th

[PATCH] D28257: [OpenCL] Re-enable supported core extensions based on opencl version when disabling all extensions using pragma

2017-01-04 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: test/SemaOpenCL/extensions.cl:47 +#ifndef _OPENCL_H_ int isnan(float x) { Why do you need this? https://reviews.llvm.org/D28257 ___ cfe-commits mailing list cfe-commi

[PATCH] D28257: [OpenCL] Re-enable supported core extensions based on opencl version when disabling all extensions using pragma

2017-01-05 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, LGTM! Thanks! https://reviews.llvm.org/D28257 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mai

[PATCH] D28080: [Docs][OpenCL] Added OpenCL feature description to user manual.

2017-01-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 83824. Anastasia added a comment. Updated with comments from Mats! https://reviews.llvm.org/D28080 Files: docs/UsersManual.rst www/index.html Index: www/index.html === --- www/index.html

[PATCH] D28080: [Docs][OpenCL] Added OpenCL feature description to user manual.

2017-01-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia marked 4 inline comments as done. Anastasia added a comment. Ping! Any more comments here? It would be nice to commit this before the 4.0 rel branch is taken (on Jan 12). https://reviews.llvm.org/D28080 ___ cfe-commits mailing list cfe-co

[PATCH] D28080: [Docs][OpenCL] Added OpenCL feature description to user manual.

2017-01-11 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 83962. Anastasia added a comment. Addressed comments from Alexey, Pekka, and Sam! https://reviews.llvm.org/D28080 Files: docs/UsersManual.rst www/index.html Index: www/index.html === ---

[PATCH] D28080: [Docs][OpenCL] Added OpenCL feature description to user manual.

2017-01-11 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia marked 16 inline comments as done. Anastasia added inline comments. Comment at: docs/UsersManual.rst:2013 +to perform machine code generation. + +Clang currently supports OpenCL standards up to v2.0. pekka.jaaskelainen wrote: > I'd like to add a sentenc

[PATCH] D28136: [OpenCL] Implement as_type operator as alias of __builtin_astype.

2017-03-15 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D28136#701508, @bader wrote: > > From all the above arguments, I feel like the right approach would be to > > implement it as Clang builtin which closely matches the operator semantic > > in my opinion. We could of course reuse the implemen

[PATCH] D30810: Preserve vec3 type.

2017-03-15 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. I don't think there is anything wrong with the generation of vec3->vec4 in Clang. I believe the motivation for this was the OpenCL spec treating vec3 as vec4 aligned type (see section 6.1.5: https://www.khronos.org/registry/OpenCL/specs/opencl-2.0-openclc.pdf#12). So

[PATCH] D30810: Preserve vec3 type.

2017-03-16 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D30810#702443, @bruno wrote: > > As a result, I think it would be good for clang to have both of features > > and I would like to stick to the option "-fpresereve-vec3' to change the > > behavior easily. > > The motivation doesn't seem soli

[PATCH] D28136: [OpenCL] Implement as_type operator as alias of __builtin_astype.

2017-03-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! Comment at: lib/Headers/opencl-c.h:6588 -char __ovld __cnfn as_char(char); -char __ovld __cnfn as_char(uchar); - bader wrote: > Anastasia

[PATCH] D30937: [OpenCL] Added diagnostic for checking length of vector

2017-03-20 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! https://reviews.llvm.org/D30937 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

[PATCH] D30830: [OpenCL] Fix extension guards for atomic functions

2017-03-20 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia closed this revision. Anastasia added a comment. Sorry, I overlooked this indeed. Committed in r298256! https://reviews.llvm.org/D30830 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/

[PATCH] D30816: [OpenCL] Added implicit conversion rank for overloading functions with vector data type in OpenCL

2017-03-20 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! https://reviews.llvm.org/D30816 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

[PATCH] D30810: Preserve vec3 type.

2017-03-21 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. > Hi Anastasia, Bruno, > > Do you still have other opinion? or Can we go ahead and commit this patch? I would like to see this patch committed. I see clear evidence of it improving existing GPU targets in the master repo as well as outside of the main tree implemen

[PATCH] D30810: Preserve vec3 type.

2017-03-21 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D30810#699428, @Anastasia wrote: > Would you be able to update ScalarExprEmitter::VisitAsTypeExpr implementation > accordingly to make things consistent? Not sure it got lost somewhere... do you think you could address this too? https://

[PATCH] D30810: Preserve vec3 type.

2017-03-21 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D30810#706676, @Anastasia wrote: > In https://reviews.llvm.org/D30810#699428, @Anastasia wrote: > > > Would you be able to update ScalarExprEmitter::VisitAsTypeExpr > > implementation accordingly to make things consistent? > > > Not sure it

[PATCH] D31183: [OpenCL] Added parsing for OpenCL vector types.

2017-03-22 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. Although nothing wrong with the implementation apart from it complicates a bit the understanding of conventional C parse flow by adding extra corner case, I don't see anything in the spec that states explicitly how the vector components should be parsed. I guess with

[PATCH] D30810: Preserve vec3 type.

2017-03-22 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D30810#707176, @jaykang10 wrote: > In https://reviews.llvm.org/D30810#706677, @Anastasia wrote: > > > In https://reviews.llvm.org/D30810#706676, @Anastasia wrote: > > > > > In https://reviews.llvm.org/D30810#699428, @Anastasia wrote: > > > >

[PATCH] D31324: [OpenCL] Extended mapping of parcing CodeGen arguments

2017-03-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! https://reviews.llvm.org/D31324 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

[PATCH] D31183: [OpenCL] Added parsing for OpenCL vector types.

2017-03-24 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D31183#709566, @echuraev wrote: > In https://reviews.llvm.org/D31183#708833, @yaxunl wrote: > > > I think this is a good feature for the convenience of user. I've seen usage > > like this. > > > I agree. I don't see any reasons why this case

[PATCH] D31183: [OpenCL] Added parsing for OpenCL vector types.

2017-03-27 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. I don't think that diagnostics can always be very clear. This is not the case neither for C nor C++. As I said I don't see any issue to continue with this patch. I would just like to see the test simplified a bit. https://reviews.llvm.org/D31183

[PATCH] D31397: [Bug 25404] Fix crash on typedef in OpenCL 2.0

2017-03-27 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. Herald added a subscriber: yaxunl. Fixing the assertion due to absence of source location for implicitly defined types (using addImplicitTypedef()). During Sema checks the source location is being expected and therefore an assertion is triggered. The change is n

[PATCH] D31397: [Bug 25404] Fix crash on typedef in OpenCL 2.0

2017-03-28 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 93225. Anastasia added a comment. Updated with the full diff. https://reviews.llvm.org/D31397 Files: lib/Sema/SemaDecl.cpp test/SemaOpenCL/types.cl Index: test/SemaOpenCL/types.cl === -

[PATCH] D31397: [Bug 25404] Fix crash on typedef in OpenCL 2.0

2017-03-28 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaDecl.cpp:2157 if (getDiagnostics().getSuppressSystemWarnings() && - (Context.getSourceManager().isInSystemHeader(Old->getLocation()) || + // Some standard types are defined implicitly in Clang (e.g. OpenCL). +

[PATCH] D31397: [Bug 25404] Fix crash on typedef in OpenCL 2.0

2017-03-28 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaDecl.cpp:2157 if (getDiagnostics().getSuppressSystemWarnings() && - (Context.getSourceManager().isInSystemHeader(Old->getLocation()) || + // Some standard types are defined implicitly in Clang (e.g. OpenCL). +

[PATCH] D31397: [Bug 25404] Fix crash on typedef in OpenCL 2.0

2017-03-28 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 93226. Anastasia added a comment. Removed check of implicit for new type. https://reviews.llvm.org/D31397 Files: lib/Sema/SemaDecl.cpp test/SemaOpenCL/types.cl Index: test/SemaOpenCL/types.cl =

[PATCH] D31397: [Bug 25404] Fix crash on typedef in OpenCL 2.0

2017-03-28 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaDecl.cpp:2157 if (getDiagnostics().getSuppressSystemWarnings() && - (Context.getSourceManager().isInSystemHeader(Old->getLocation()) || + // Some standard types are defined implicitly in Clang (e.g. OpenCL). +

[PATCH] D31183: [OpenCL] Added parsing for OpenCL vector types.

2017-03-28 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! https://reviews.llvm.org/D31183 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinf

[PATCH] D31321: [OpenCL] Do not generate "kernel_arg_type_qual" metadata for non-pointer args

2017-03-28 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: test/CodeGenOpenCL/kernel-arg-info.cl:66 // CHECK: ![[MD13]] = !{!"int*", !"int", !"int", !"float*"} -// CHECK: ![[MD14]] = !{!"restrict", !"const", !"volatile", !"restrict const"} // ARGINFO: ![[MD15]] = !{!"X", !"Y", !"anotherArg",

[PATCH] D30643: [OpenCL] Extended diagnostics for atomic initialization

2017-03-28 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: test/SemaOpenCL/atomic-init.cl:6 +kernel void test_atomic_initialization() { + a1 = 1; // expected-error {{atomic variable can only be assigned to a compile time constant and to variables in global adress space}} + atomic_int a2 = 0

[PATCH] D31404: [OpenCL] Allow alloca return non-zero private pointer

2017-03-30 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. I can't see clearly why the alloca has to be extended to accommodate the address space too? Couldn't the address space for alloca just be taken directly from the data layout? In fact is seems from the LLVM review, an address space for alloca doesn't go into the bitc

[PATCH] D31321: [OpenCL] Do not generate "kernel_arg_type_qual" metadata for non-pointer args

2017-03-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! Comment at: test/CodeGenOpenCL/kernel-arg-info.cl:66 // CHECK: ![[MD13]] = !{!"int*", !"int", !"int", !"float*"} -// CHECK: ![[MD14]] = !{!"restrict", !"const",

[PATCH] D30643: [OpenCL] Extended diagnostics for atomic initialization

2017-03-30 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: test/SemaOpenCL/atomic-init.cl:6 +kernel void test_atomic_initialization() { + a1 = 1; // expected-error {{atomic variable can only be assigned to a compile time constant and to variables in global adress space}} + atomic_int a2 = 0

[PATCH] D31404: [OpenCL] Allow alloca return non-zero private pointer

2017-03-31 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D31404#714906, @yaxunl wrote: > In https://reviews.llvm.org/D31404#714244, @Anastasia wrote: > > > I can't see clearly why the alloca has to be extended to accommodate the > > address space too? Couldn't the address space for alloca just be

[PATCH] D30643: [OpenCL] Extended diagnostics for atomic initialization

2017-03-31 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: test/SemaOpenCL/atomic-init.cl:6 +kernel void test_atomic_initialization() { + a1 = 1; // expected-error {{atomic variable can only be assigned to a compile time constant}} + atomic_int a2 = 0; // expected-error {{atomic variable ca

[PATCH] D31404: [OpenCL] Allow alloca return non-zero private pointer

2017-04-03 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: include/clang/AST/ASTContext.h:2328 +return AddrSpaceMapMangling || + AS >= LangAS::target_first; } So we couldn't use the LangAS::Count instead? I have the same comment in other places that use Lan

[PATCH] D31594: [OpenCL] Enables passing sampler initializer to function argument

2017-04-03 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: test/SemaOpenCL/sampler_t.cl:68 foo(argsmp); - foo(5); // expected-error{{sampler_t variable required - got 'int'}} + foo(CLK_ADDRESS_CLAMP_TO_EDGE | CLK_NORMALIZED_COORDS_TRUE | CLK_FILTER_LINEAR); sampler_t sa[] = {argsmp, c

[PATCH] D31594: [OpenCL] Enables passing sampler initializer to function argument

2017-04-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! https://reviews.llvm.org/D31594 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinf

[PATCH] D30810: Preserve vec3 type.

2017-04-04 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D30810#710069, @jaykang10 wrote: > > I believe the argument lacks numbers (or at least you have them but didn't > > mention). I didn't hear about performance results, or validation that this > > was actually tested for correctness. Small te

[PATCH] D30810: Preserve vec3 type.

2017-04-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! https://reviews.llvm.org/D30810 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

[PATCH] D30643: [OpenCL] Extended diagnostics for atomic initialization

2017-04-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! https://reviews.llvm.org/D30643 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

[PATCH] D31404: [OpenCL] Allow alloca return non-zero private pointer

2017-04-04 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: include/clang/AST/ASTContext.h:2328 +return AddrSpaceMapMangling || + AS >= LangAS::target_first; } yaxunl wrote: > Anastasia wrote: > > So we couldn't use the LangAS::Count instead? > > > > I have

[PATCH] D31404: [OpenCL] Allow alloca return non-zero private pointer

2017-04-04 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: include/clang/AST/ASTContext.h:2328 +return AddrSpaceMapMangling || + AS >= LangAS::target_first; } Anastasia wrote: > yaxunl wrote: > > Anastasia wrote: > > > So we couldn't use the LangAS::Count in

[PATCH] D31404: [OpenCL] Allow alloca return non-zero private pointer

2017-04-06 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: include/clang/AST/ASTContext.h:2328 +return AddrSpaceMapMangling || + AS >= LangAS::target_first; } yaxunl wrote: > yaxunl wrote: > > Anastasia wrote: > > > Anastasia wrote: > > > > yaxunl wrote: > >

[PATCH] D31745: [OpenCL] Added diagnostic for implicit declaration of function in OpenCL

2017-04-06 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:8254 "%0 cannot be used as the type of a kernel parameter">; +def err_opencl_implicit_function_decl : Error< + "implicit declaration of function %0 is invalid in OpenCL">;

[PATCH] D26794: [OpenCL] Blocks are allowed to capture arrays in OpenCL 2.0 and higher.

2017-04-06 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D26794#598784, @Anastasia wrote: > I have created a bug to Khronos regarding this, but unfortunately I don't see > it being progressed yet. > https://cvs.khronos.org/bugzilla/show_bug.cgi?id=15659 > > The problem here is that I am not sure

[PATCH] D31745: [OpenCL] Added diagnostic for implicit declaration of function in OpenCL

2017-04-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:8254 "%0 cannot be used as the type of a kernel parameter">; +def err_opencl_implicit_function_decl : Error< + "implicit declaration of function %0 is invalid in OpenCL">;

[PATCH] D31745: [OpenCL] Added diagnostic for implicit declaration of function in OpenCL

2017-04-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: test/SemaOpenCL/clang-builtin-version.cl:32 + work_group_reserve_write_pipe(tmp, tmp); // expected-error{{implicit declaration of function 'work_group_reserve_write_pipe' is invalid in OpenCL}} + // expected-note@-1{{did you mean 'w

[PATCH] D31404: [OpenCL] Allow alloca return non-zero private pointer

2017-04-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: include/clang/Basic/AddressSpaces.h:32 + // QualType represents private address space in OpenCL source code. + Default = 0, + yaxunl wrote: > Anastasia wrote: > > The alloca AS is not taken from the target AS map but

[PATCH] D26794: [OpenCL] Blocks are allowed to capture arrays in OpenCL 2.0 and higher.

2017-04-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaExpr.cpp:13645 // Blocks are not allowed to capture arrays. + if (!S.getLangOpts().OpenCL && CaptureType->isArrayType()) { I think the comment should be updated. Comment at:

[PATCH] D31404: [OpenCL] Allow alloca return non-zero private pointer

2017-04-11 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. LGTM! Thanks! https://reviews.llvm.org/D31404 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D28080: [Docs][OpenCL] Added OpenCL feature description to user manual.

2017-01-12 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 84136. Anastasia added a comment. Update based on comments from Pekka. https://reviews.llvm.org/D28080 Files: docs/UsersManual.rst www/index.html Index: docs/UsersManual.rst === --- docs

[PATCH] D28080: [Docs][OpenCL] Added OpenCL feature description to user manual.

2017-01-12 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: docs/UsersManual.rst:2130 + +- x86 is used by some implementations that are x86 compatible + (e.g. `POCL `_) and currently remains for backwards pekka.jaaskelainen wrote: > Anastasia wrote: > >

[PATCH] D28080: [Docs][OpenCL] Added OpenCL feature description to user manual.

2017-01-12 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. Since everyone agreed on the core part of this documentation I have committed the current revision in 291780 to make it easier for the release. Feel free to give me more feedback (if any) as small changes can still be merged in. @yaxunl Sam, I think it would be nice

[PATCH] D28080: [Docs][OpenCL] Added OpenCL feature description to user manual.

2017-01-13 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D28080#644222, @yaxunl wrote: > > @yaxunl Sam, I think it would be nice to describe your recent change for > > adding OpenCL extensions. Would you like to write up some text? Otherwise I > > can draft something and you can review. :) > > An

[PATCH] D28814: [OpenCL] Add missing address spaces in IR generation of Blocks

2017-01-17 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. ObjC IR generation for Blocks currently: I. Generates local to block variable declaration block literal in case it contains captures. II. Global variable block literal in case it doesn't have any captures. The address spaces are missing however if we use this gen

[PATCH] D28080: [Docs][OpenCL] Added OpenCL feature description to user manual.

2017-01-17 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: docs/UsersManual.rst:2065 + + $ clang -cc1 -triple spir64-unknown-unknown -cl-ext=-cl_khr_fp64 test.cl + pekka.jaaskelainen wrote: > Is this correct? I cannot make it work: > > ``` > ~/local/stow/llvm-4.0-unpatche

[PATCH] D28080: [Docs][OpenCL] Added OpenCL feature description to user manual.

2017-01-20 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. @pekka.jaaskelainen, I just compiled the release 4.0 branch and it all works for me as expected: clang -cc1 -triple spir64-unknown-unknown test.cl clang -target spir64-unknown-unknown test.cl https://reviews.llvm.org/D28080

[PATCH] D28080: [Docs][OpenCL] Added OpenCL feature description to user manual.

2017-01-23 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. > (I should pass -finclude-default-header after -cc1 without -Xclang then it > works, but I think also the > latter version should work, no?) In general -cc1 and -Xclang have similar effect so I either should work indeed. > Also, I cannot add -S (even with -emit-llvm

[PATCH] D28814: [OpenCL] Add missing address spaces in IR generation of Blocks

2017-01-23 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. Ping! @yaxunl, Sam do you think you will have time to look into this? https://reviews.llvm.org/D28814 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D29038: [OpenCL] Accept logical NOT for pointer types in CL1.0 and CL1.1

2017-01-23 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. Herald added a subscriber: yaxunl. A bug is reported regarding incorrect error given for logical NOT operation with a pointer type: https://llvm.org/bugs/show_bug.cgi?id=30217 Detailed investigation shows that this has only been a problem for CL earlier than v1.

[PATCH] D29038: [OpenCL] Accept logical NOT for pointer types in CL1.0 and CL1.1

2017-01-23 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 85418. Anastasia added a comment. Added missing test! https://reviews.llvm.org/D29038 Files: lib/Sema/SemaExpr.cpp test/SemaOpenCL/invalid-logical-ops-1.1.cl test/SemaOpenCL/invalid-logical-ops-1.2.cl test/SemaOpenCL/logical-ops.cl Index: test/Se

[PATCH] D28860: [OpenCL] Diagnose write_only image3d when extension is disabled

2017-01-25 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia closed this revision. Anastasia added a comment. Committed in r293050! https://reviews.llvm.org/D28860 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D28814: [OpenCL] Add missing address spaces in IR generation of Blocks

2017-01-25 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 85753. Anastasia added a comment. Switched to getNullPointer helper. https://reviews.llvm.org/D28814 Files: lib/AST/Expr.cpp lib/CodeGen/CGBlocks.cpp lib/CodeGen/CGBuiltin.cpp lib/Sema/SemaExpr.cpp lib/Sema/SemaType.cpp test/CodeGenOpenCL/cl20

[PATCH] D28814: [OpenCL] Add missing address spaces in IR generation of Blocks

2017-01-25 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/CodeGen/CGBlocks.cpp:723 +? CGM.getNSConcreteStackBlock() +: llvm::Constant::getNullValue( + CGM.getNSConcreteStackBlock()->getType()); --

<    9   10   11   12   13   14   15   16   17   18   >