[PATCH] D50259: [OpenCL] Disallow negative attribute arguments

2018-08-17 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! Repository: rC Clang https://reviews.llvm.org/D50259 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org

[PATCH] D46601: [OpenCL] Fix typos in emitted enqueue kernel function names

2018-05-09 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! Although I think `vaarg` is common too. :) https://reviews.llvm.org/D46601 ___ cfe-commits mailing list cfe-commits@lists.llvm.org ht

[PATCH] D46667: [OpenCL, OpenMP] Fix crash when OpenMP used in OpenCL file

2018-05-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. OpenCL C is based on C99, so OpenMP isn't enabled by default. But in your tests you use `-fopenmp` to activate it. OpenCL general philosophy is that vectors are written explicitly, but it's not always very easy. In OpenCL C++ we have added an attribute hint for auto

[PATCH] D46667: [OpenCL, OpenMP] Fix crash when OpenMP used in OpenCL file

2018-05-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaDecl.cpp:11348 // initialiser -if (var->getTypeSourceInfo()->getType()->isBlockPointerType() && -!var->hasInit()) { +if (var->getType()->isBlockPointerType() && !var->hasInit()) { Diag(var->getL

[PATCH] D46667: [OpenCL, OpenMP] Fix crash when OpenMP used in OpenCL file

2018-05-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaDecl.cpp:11348 // initialiser -if (var->getTypeSourceInfo()->getType()->isBlockPointerType() && -!var->hasInit()) { +if (var->getType()->isBlockPointerType() && !var->hasInit()) { Diag(var->getL

[PATCH] D47154: Try to make builtin address space declarations not useless

2018-05-22 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: include/clang/Basic/BuiltinsAMDGPU.def:49 + +// FIXME: Need to disallow constant address space. BUILTIN(__builtin_amdgcn_div_scale, "dddbb*", "n") Do you plan to provide the support for it later? Or if else perhaps we

[PATCH] D46501: [OpenCL] Guard all half float usage based on cl_khr_fp16 extension

2018-05-23 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D46501#1089777, @yaxunl wrote: > Only halfn type requires cl_khr_fp16. These functions do not use halfn type, > therefore cl_khr_fp16 is not required. I think the extension is for all half https://www.khronos.org/registry/OpenCL/sdk/1.2/d

[PATCH] D46501: [OpenCL] Guard all half float usage based on cl_khr_fp16 extension

2018-05-23 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. Could you upload the full diff please, otherwise it's not easy to see all the functions guarded by the macro. Repository: rC Clang https://reviews.llvm.org/D46501 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

[PATCH] D46667: [OpenCL, OpenMP] Fix crash when OpenMP used in OpenCL file

2018-05-23 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/SemaOpenCL/with_openmp.cl:1 +// RUN: %clang_cc1 -verify -fopenmp -ast-dump -x cl %s 2>&1 | FileCheck %s +// expected-no-diagnostics -

[PATCH] D37804: [OpenCL] Handle address space conversion while setting type alignment

2017-09-25 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 116548. Anastasia added a comment. Addressed comments from Alexey. https://reviews.llvm.org/D37804 Files: lib/CodeGen/CGBuilder.h lib/CodeGen/CGExpr.cpp test/CodeGenOpenCL/vectorLoadStore.cl Index: test/CodeGenOpenCL/vectorLoadStore.cl ===

[PATCH] D38134: [OpenCL] Emit enqueued block as kernel

2017-09-25 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. I think we should add a test case when the same block is both called and enqueued. Comment at: lib/CodeGen/CGOpenCLRuntime.cpp:113 + +llvm::Value *CGOpenCLRuntime::emitOpenCLEnqueuedBlock(CodeGenFunction &CGF, +

[PATCH] D37822: [OpenCL] Clean up and add missing fields for block struct

2017-09-25 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/CodeGen/CGBlocks.cpp:311 +// The header is basically 'struct { int; int; generic void *; +// custom_fields; }'. Assert that that struct is packed. +auto GenPtrAlign = CharUnits::fromQuantity( remove one

[PATCH] D38113: OpenCL: Assume functions are convergent

2017-09-27 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D38113#878852, @hfinkel wrote: > In https://reviews.llvm.org/D38113#877874, @Anastasia wrote: > > > The problem of adding this attribute conservatively for all functions is > > that it prevents some optimizations to happen. I agree to commit

[PATCH] D38113: OpenCL: Assume functions are convergent

2017-09-27 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D38113#878840, @jlebar wrote: > > Yes, that's why if it would be responsibility of the kernel developer to > > specify this explicitly we could avoid this complications in the compiler. > > But if we add it into the language now we still ne

[PATCH] D35082: [OpenCL] Add LangAS::opencl_private to represent private address space in AST

2017-09-27 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaType.cpp:6808 +static void deduceOpenCLImplicitAddrSpace(TypeProcessingState &State, + QualType &T, TypeAttrLocation TAL) { Great! This looks so clear now!

[PATCH] D37804: [OpenCL] Handle address space conversion while setting type alignment

2017-09-27 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. Committed in r314304 In https://reviews.llvm.org/D37804#882252, @alekseyshl wrote: > vectorLoadStore.cl is failing on our bots: > http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/8187, > please check it out I will commit a fix in a bit. Reposi

[PATCH] D37804: [OpenCL] Handle address space conversion while setting type alignment

2017-09-27 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. Committed in r314317. Repository: rL LLVM https://reviews.llvm.org/D37804 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D37822: [OpenCL] Clean up and add missing fields for block struct

2017-10-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! Comment at: test/CodeGenOpenCL/blocks.cl:30 + // COMMON: %[[block_captured:.*]] = getelementptr inbounds <{ i32, i32, i8 addrspace(4)*, i32 }>, <{ i32,

[PATCH] D35082: [OpenCL] Add LangAS::opencl_private to represent private address space in AST

2017-10-04 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaType.cpp:6872 + ImpAddr = LangAS::opencl_private; +else if (IsStatic) + ImpAddr = LangAS::opencl_global; yaxunl wrote: > Anastasia wrote: > > I think we can't have this case for CL1.2 see s6.

[PATCH] D38134: [OpenCL] Emit enqueued block as kernel

2017-10-06 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/CodeGen/CGOpenCLRuntime.cpp:144 + if (auto *I = dyn_cast(V)) { +// If the block literal is emitted as an instruction, it is an alloca +// and the block invoke function is stored to GEP of this alloca. Why

[PATCH] D35082: [OpenCL] Add LangAS::opencl_private to represent private address space in AST

2017-10-06 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D35082#890162, @rjmccall wrote: > Okay. I think I see your point about why it would be better to have a > canonical __private address space that is different from the implicit address > space 0. I assume this means that there should basic

[PATCH] D38113: OpenCL: Assume functions are convergent

2017-10-06 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/D38113 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinf

[PATCH] D38134: [OpenCL] Emit enqueued block as kernel

2017-10-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/CodeGen/CGOpenCLRuntime.cpp:144 + if (auto *I = dyn_cast(V)) { +// If the block literal is emitted as an instruction, it is an alloca +// and the block invoke function is stored to GEP of this alloca. yaxu

[PATCH] D35082: [OpenCL] Add LangAS::opencl_private to represent private address space in AST

2017-10-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. > (*) I know that you aren't considering OpenCL C++ yet, but often these > representation/model questions are easier to answer when thinking about C++ > instead of C because type differences are so much more directly important in > C++. In OpenCL C++, I assume it w

[PATCH] D33681: [OpenCL] Allow function declaration with empty argument list.

2017-10-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. I would prefer to merge the new test with test/SemaOpenCL/func.cl, but otherwise LGTM! Thanks! https://reviews.llvm.org/D33681 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http

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

2017-10-12 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: cfe/trunk/lib/Basic/TargetInfo.cpp:351 +LangAS::ID TargetInfo::getOpenCLTypeAddrSpace(const Type *T) const { + auto BT = dyn_cast(T); chapuni wrote: > Excuse me for old commit, I think it might be layering violation

[PATCH] D38134: [OpenCL] Emit enqueued block as kernel

2017-10-12 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. I think it would be good to add a block test to CodeGenOpenCL where we would just call the block without any enqueue and check that the invoke function is generated but the kernel wrapper isn't. Comment at: lib/CodeGen/CGBuiltin.cpp:2846 +

[PATCH] D38816: Convert clang::LangAS to a strongly typed enum

2017-10-12 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/AST/TypePrinter.cpp:1323 OS << "address_space("; -OS << T->getEquivalentType().getAddressSpace(); +OS << T->getEquivalentType() + .getQualifiers() Why do we need this change? https://rev

[PATCH] D38868: [OpenCL] Restrict swizzle length check to OpenCL mode

2017-10-13 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: test/SemaOpenCL/vector_swizzle_length.cl:7 void foo() { -float8 f2 = (float8)(0, 0, 0, 0, 0, 0, 0, 0); +float8 f2 = (float8){0, 0, 0, 0, 0, 0, 0, 0}; Even though this works in Clang, ideally OpenCL vector li

[PATCH] D38816: Convert clang::LangAS to a strongly typed enum

2017-10-13 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/AST/TypePrinter.cpp:1323 OS << "address_space("; -OS << T->getEquivalentType().getAddressSpace(); +OS << T->getEquivalentType() + .getQualifiers() arichardson wrote: > Anastasia wrote: > >

[PATCH] D38857: [OpenCL] Improve printing and semantic check related to implicit addr space

2017-10-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! Thanks! Can we close https://bugs.llvm.org/show_bug.cgi?id=33418 after this commit? Comment at: test/SemaOpenCL/null_literal.cl:38 -#ifdef CL20 -// Accept expl

[PATCH] D38134: [OpenCL] Emit enqueued block as kernel

2017-10-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! Great work! Thanks! https://reviews.llvm.org/D38134 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi

[PATCH] D38816: Convert clang::LangAS to a strongly typed enum

2017-10-13 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/AST/TypePrinter.cpp:1323 OS << "address_space("; -OS << T->getEquivalentType().getAddressSpace(); +OS << T->getEquivalentType() + .getQualifiers() arichardson wrote: > Anastasia wrote: > >

[PATCH] D38868: [OpenCL] Restrict swizzle length check to OpenCL mode

2017-10-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! Comment at: test/SemaOpenCL/vector_swizzle_length.cl:7 void foo() { -float8 f2 = (float8)(0, 0, 0, 0, 0, 0, 0, 0); +float8 f2 = (float8){0, 0, 0, 0, 0, 0

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

2017-10-20 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. After the change of constant address space function scope variable in 6e34f0e ("[OpenCL] Emit function-scope variable in constant address space as static variable", 2017-05-15) a bug has been introduced that triggered unreachable during generation of samplers.

[PATCH] D51212: [OpenCL][Docs] Release notes for OpenCL in Clang

2018-08-24 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. Anastasia added reviewers: hans, bader, yaxunl. https://reviews.llvm.org/D51212 Files: docs/ReleaseNotes.rst Index: docs/ReleaseNotes.rst === --- docs/ReleaseNotes.rst +++ docs/ReleaseNotes.rst @@

[PATCH] D43783: [OpenCL] Remove block invoke function from emitted block literal struct

2018-08-28 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D43783#1212485, @yaxunl wrote: > In https://reviews.llvm.org/D43783#1204353, @svenvh wrote: > > > Sorry for digging up an old commit... > > > > Apparently this broke block arguments, e.g. the following test case: > > > > int foo(int (^ bl)(

[PATCH] D51212: [OpenCL][Docs] Release notes for OpenCL in Clang

2018-08-28 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D51212#1214173, @hans wrote: > Anastasia: will you commit this to the branch, or would like me to do it? I will commit this! Thanks! https://reviews.llvm.org/D51212 ___ cfe-commits mailing li

[PATCH] D51296: [Sema] Traverse vector types for ocl extensions support

2018-08-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! Thanks! Could you please change the commit title tag: [Sema] -> [OpenCL] Comment at: lib/Sema/Sema.cpp:42 #include "llvm/ADT/SmallSet.h" + using namespace clang

[PATCH] D51302: [OpenCL] Relax diagnostics on OpenCL access qualifiers

2018-08-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! Thanks! Comment at: test/SemaOpenCL/access-qualifier.cl:107 + +kernel void image_wo_twice(write_only write_only image1d_t i){} // expected-warning {{duplicate 'w

[PATCH] D51341: [HEADER] Overloadable function candidates for half/double types

2018-08-29 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaOverload.cpp:6063 + // OpenCL: A candidate function that uses extentions that are not enabled or + // supported is not viable. + if (getLangOpts().OpenCL) { I would imagine if extension isn't supported

[PATCH] D51341: [HEADER] Overloadable function candidates for half/double types

2018-08-29 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. I think this is related to: https://reviews.llvm.org/D46501 https://reviews.llvm.org/D51341 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D51402: [OpenCL] Adding cl_intel_planar_yuv extension

2018-08-29 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. Will this extension require any Clang changes that are not possible to add using this approach for vendor extensions: https://clang.llvm.org/docs/UsersManual.html#opencl-extensions If not I would suggest to add this to the header file instead. Repository: rC Clang

[PATCH] D51411: [OpenCL] Improve diagnostic of argument in address space conversion builtins

2018-09-05 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D51411#1217477, @yaxunl wrote: > Is this a feature requested by users? > > I can understand that this may be useful to pinpoint some conversions which > are potentially harmful to performance. However such conversions can often be > elimina

[PATCH] D51484: [OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extension

2018-09-05 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: include/clang/Basic/OpenCLExtensionTypes.def:1 +//===-- OpenCLExtensionTypes.def - Metadata about BuiltinTypes --*- C++ -*-===// +// I am confused about the purpose of this file. Is it supposed to contain intel e

[PATCH] D51544: [OpenCL] Split opencl-c.h header

2018-09-05 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. It seems generally good to partition this big header but I am trying to understand what problem is it trying to solve now? The unsupported declarations are guarded out by `#if defined(ext_name)` and therefore won't be parsed and put into PCH is extensions are not supp

[PATCH] D51722: [OpenCL] Allow blocks to capture arrays in OpenCL

2018-09-06 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! There is a small comment that can be addressed before the final commit. Thanks! Comment at: lib/Sema/SemaExpr.cpp:14627 - // Blocks are not allowed to capture

[PATCH] D51402: [OpenCL] Adding cl_intel_planar_yuv extension

2018-09-06 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Headers/opencl-c.h:26 +#if __OPENCL_C_VERSION__ >= CL_VERSION_1_2 +#ifndef cl_intel_planar_yuv +#define cl_intel_planar_yuv @yaxunl, do you think we need to add some kind of architecture guard for such things? Lik

[PATCH] D51484: [OpenCL] Add support of cl_intel_device_side_avc_motion_estimation extension

2018-09-06 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: include/clang/Basic/OpenCLExtensionTypes.def:27 + +INTEL_SGAVC_TYPE(mce_payload_t, McePayload) +INTEL_SGAVC_TYPE(ime_payload_t, ImePayload) AlexeySachkov wrote: > Anastasia wrote: > > From the specification of this ext

[PATCH] D51544: [OpenCL] Split opencl-c.h header

2018-09-07 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D51544#1224780, @asavonic wrote: > In https://reviews.llvm.org/D51544#1224730, @Anastasia wrote: > > > It seems generally good to partition this big header but I am trying to > > understand what problem is it trying to solve now? > > > Main

[PATCH] D51544: [OpenCL] Split opencl-c.h header

2018-09-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D51544#1227336, @asavonic wrote: > In https://reviews.llvm.org/D51544#1227313, @Anastasia wrote: > > > Currently the main header still contains everything, so the size of the PCH > > won't change. > > > The idea is that we don't pre-compile

[PATCH] D51544: [OpenCL] Split opencl-c.h header

2018-09-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. > With this setup, we can compile opencl-c-common.h, opencl-c-fp16.h and > opencl-c-fp64.h into PCHs with one set of extensions/OpenCL version, > and use them for any other set of extensions/OpenCL version. Clang > will detect this and throw out an error, which can be

[PATCH] D51341: [HEADER] Overloadable function candidates for half/double types

2018-09-10 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaOverload.cpp:6063 + // OpenCL: A candidate function that uses extentions that are not enabled or + // supported is not viable. + if (getLangOpts().OpenCL) { sidorovd wrote: > Anastasia wrote: > > I woul

[PATCH] D51544: [OpenCL] Split opencl-c.h header

2018-09-11 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D51544#1230264, @asavonic wrote: > In https://reviews.llvm.org/D51544#1229105, @Anastasia wrote: > > > > With this setup, we can compile opencl-c-common.h, opencl-c-fp16.h and > > > opencl-c-fp64.h into PCHs with one set of extensions/OpenCL

[PATCH] D43783: [OpenCL] Remove block invoke function from emitted block literal struct

2018-09-14 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. Ping! Do you still plan to do this? :) Repository: rC Clang https://reviews.llvm.org/D43783 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D51411: [OpenCL] Improve diagnostic of argument in address space conversion builtins

2018-09-14 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/D51411 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinf

[PATCH] D49723: [OpenCL] Check for invalid kernel arguments in array types

2018-07-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: rC Clang https://reviews.llvm.org/D49723 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.

[PATCH] D49725: [OpenCL] Forbid size dependent types used as kernel arguments

2018-07-24 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaDecl.cpp:8186 - const RecordDecl *PD = PT->castAs()->getDecl(); - VisitStack.push_back(PD); + // At this point we already handled everything except of a RecordType or + // an ArrayType[RecordType]. I

[PATCH] D49723: [OpenCL] Check for invalid kernel arguments in array types

2018-07-24 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. Btw, has this restriction been removed from CL 2.0? Repository: rC Clang https://reviews.llvm.org/D49723 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D49725: [OpenCL] Forbid size dependent types used as kernel arguments

2018-07-26 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaDecl.cpp:8267 - S.Diag(PD->getLocation(), diag::note_within_field_of_type) -<< PD->getDeclName(); + S.Diag(OrigRecDecl->getLocation(), diag::note_within_field_of_type) + << OrigRecDecl->getDecl

[PATCH] D49725: [OpenCL] Forbid size dependent types used as kernel arguments

2018-07-27 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. LGTM! Thanks! Repository: rC Clang https://reviews.llvm.org/D49725 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D49723: [OpenCL] Check for invalid kernel arguments in array types

2018-07-27 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D49723#1174837, @asavonic wrote: > In https://reviews.llvm.org/D49723#1173352, @Anastasia wrote: > > > Btw, has this restriction been removed from CL 2.0? > > > No, it applies for CL2.0 as well. It seems however the restriction on pointer t

[PATCH] D47618: __c11_atomic_load's _Atomic can be const

2018-07-27 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: test/SemaOpenCL/atomic-ops.cl:61 __opencl_atomic_load(d, memory_order_seq_cst, memory_scope_work_group); - __opencl_atomic_load(ci, memory_order_seq_cst, memory_scope_work_group); // expected-error {{address argument to atomic ope

[PATCH] D49723: [OpenCL] Check for invalid kernel arguments in array types

2018-07-27 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia accepted this revision. Anastasia added a comment. LGTM! Thanks! Repository: rC Clang https://reviews.llvm.org/D49723 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D47154: Try to make builtin address space declarations not useless

2018-07-27 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 from OpenCL side! Thanks! Comment at: test/SemaOpenCL/numbered-address-space.cl:9 +void test_numeric_as_to_generic_explicit_cast(__attribute__((address_space(3)))

[PATCH] D47618: __c11_atomic_load's _Atomic can be const

2018-07-31 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 from OpenCL side! Thanks! Repository: rC Clang https://reviews.llvm.org/D47618 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[PATCH] D42844: [OpenCL] Add test for atomic pointers.

2018-02-08 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. Sorry for delay... Does this test anything OpenCL specific? As far as I remember we don't have any changes to `PointerType` with an atomic pointee type. Repository: rC Clang https://reviews.llvm.org/D42844 ___ cfe-comm

[PATCH] D42844: [OpenCL] Add test for atomic pointers.

2018-02-12 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D42844#1004663, @Fznamznon wrote: > Yes, we don't have anything OpenCL specific for atomic pointers. > But we have OpenCL specific in pointers and atomics separately and we have > address spaces. > Why not to test all at once? We don't

[PATCH] D43240: [OpenCL] Fix __enqueue_block for block with captures

2018-02-15 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 for looking at this. Just one thing, I was wondering whether it would be cleaner way if we extend test/CodeGenOpenCL/cl20-device-side-enqueue.cl instead of adding a new one

[PATCH] D43570: [OpenCL] Add '-cl-uniform-work-group-size' compile option

2018-02-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: rC Clang https://reviews.llvm.org/D43570 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.

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

2017-05-24 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/Sema/SemaDecl.cpp:12449 // function declaration is going to be treated as an error. - if (Diags.getDiagnosticLevel(diag_id, Loc) >= DiagnosticsEngine::Error) { + if (!getLangOpts().OpenCL && + Diags.getDiagnosticLevel(dia

[PATCH] D33353: [OpenCL] An error shall occur if any scalar operand has greater rank than the type of the vector element

2017-05-24 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: include/clang/Basic/DiagnosticSemaKinds.td:8307 "variable length arrays are not supported in OpenCL">; +def err_scalar_type_rank_greater_than_vector_type : Error< +"scalar operand type has greater rank than the type of the vecto

[PATCH] D33483: [OpenCL] reserve_id_t cannot be used as argument to kernel function

2017-05-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! Btw the same applies to the program scope declaration (s6.9.p), but could be done as a separate change. https://reviews.llvm.org/D33483

[PATCH] D33489: [OpenCL] Added regression test on invalid vector initialization.

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

[PATCH] D33353: [OpenCL] An error shall occur if any scalar operand has greater rank than the type of the vector element

2017-05-26 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/D33353 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

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

2017-05-26 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/D31745 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

[PATCH] D33592: [OpenCL] Test on half immediate support.

2017-05-26 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/D33592 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

[PATCH] D33597: [OpenCL] Fix pipe size in TypeInfo.

2017-05-26 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. Herald added a subscriber: yaxunl. Pipes are now the size of pointers rather than the size of the type that they contain. Patch by Simon Perretta! https://reviews.llvm.org/D33597 Files: lib/AST/ASTContext.cpp test/Index/pipe-size.cl Index: test/Index/pip

[PATCH] D33598: [libclang] [OpenCL] Expose CIndex functions for typedef and address space

2017-05-26 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. Expose the following functions: clang_getTypedefName clang_getAddressSpace Patch by Simon Perretta! https://reviews.llvm.org/D33598 Files: bindings/python/clang/cindex.py bindings/python/tests/cindex/test_type.py include/clang-c/Index.h tools/libclang/C

[PATCH] D33706: [AMDGPU] Fix address space for global and temporary variables in C++

2017-05-31 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: lib/CodeGen/CGDecl.cpp:1107 assert(T.getAddressSpace() == LangAS::Default); if (getASTAllocaAddressSpace() != LangAS::Default) { auto *Addr = getTargetHooks().performAddrSpaceCast( Is this code still needed

[PATCH] D33597: [OpenCL] Fix pipe size in TypeInfo.

2017-06-01 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 101031. Anastasia edited reviewers, added: yaxunl; removed: echuraev. Anastasia removed a subscriber: yaxunl. Anastasia added a comment. Use global AS pointer for pipe size. @Sam, I am moving you to the reviewer to finish this change. Do you think it makes

[PATCH] D33597: [OpenCL] Fix pipe size in TypeInfo.

2017-06-02 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia updated this revision to Diff 101236. Anastasia added a comment. Added RUN line for AMD https://reviews.llvm.org/D33597 Files: lib/AST/ASTContext.cpp test/Index/pipe-size.cl Index: test/Index/pipe-size.cl === --- /d

[PATCH] D33821: [OpenCL] Harden function pointer diagnostics.

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

[PATCH] D33598: [libclang] [OpenCL] Expose CIndex functions for typedef and address space

2017-06-07 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. Sam, do you think you have some time to look at this change? Thanks! https://reviews.llvm.org/D33598 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

[PATCH] D33681: Allow function declaration with empty argument list.

2017-06-07 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/D33681 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

[PATCH] D34235: [OpenCL] Fix OpenCL and SPIR version metadata generation.

2017-06-19 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: test/CodeGenOpenCL/spir_version.cl:13 kernel void foo() {} +kernel void bar() {} Would the original code produce duplicate version metadata here or is it just for overloaded functions? Would it make sense to add `C

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

2017-06-19 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: include/clang/Basic/TargetInfo.h:1041 +default: + return LangAS::Default; +} bader wrote: > yaxunl wrote: > > bader wrote: > > > yaxunl wrote: > > > > I think the default (including even_t, clk_event_t, qu

[PATCH] D34024: [OpenCL] Diagnose scoped address-space qualified variables

2017-06-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! Small comment in the test can be addressed in commit! Comment at: test/SemaOpenCL/storageclass.cl:52 +kernel void invalidScope() { + if (true) { +local int l

[PATCH] D34235: [OpenCL] Fix OpenCL and SPIR version metadata generation.

2017-06-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/D34235 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

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

2017-06-20 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: test/CodeGenOpenCL/sampler.cl:62 + + const sampler_t const_smp = CLK_ADDRESS_CLAMP_TO_EDGE | CLK_NORMALIZED_COORDS_TRUE | CLK_FILTER_LINEAR; + // CHECK: [[CONST_SAMP:%[0-9]+]] = call %opencl.sampler_t addrspace(2)* @__translate_sam

[PATCH] D28691: Add OpenCL 2.0 atomic builtin functions as Clang builtin

2017-06-20 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: include/clang/Basic/Builtins.def:713 +ATOMIC_BUILTIN(__opencl_atomic_fetch_or, "v.", "t") +ATOMIC_BUILTIN(__opencl_atomic_fetch_xor, "v.", "t") + What about min/max? I believe they will need to have the scope too. =

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

2017-06-21 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D34342#785454, @bader wrote: > Wow... > Nice catch. > For some reason I can't reproduce the problem neither. > I will drop source code change, but I'd like to modify the test anyway. I think we probably had this issue at some point... Ca

[PATCH] D47630: [Sema] Allow creating types with multiple of the same addrspace.

2018-06-05 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: test/Sema/address_spaces.c:17 int *_AS1 _AS2 *Z; // expected-error {{multiple address spaces specified for type}} + int *_AS1 _AS1 *M; ebevhan wrote: > bader wrote: > > I think it might be valuable to give a wa

[PATCH] D46651: [OpenCL] Support placement new/delete in Sema

2018-06-08 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia requested changes to this revision. Anastasia added inline comments. This revision now requires changes to proceed. Comment at: lib/Sema/SemaExprCXX.cpp:2030 + } +} svenvh wrote: > rjmccall wrote: > > I think a better interpretation of this r

[PATCH] D47154: Try to make builtin address space declarations not useless

2018-06-12 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added inline comments. Comment at: include/clang/Basic/BuiltinsAMDGPU.def:49 + +// FIXME: Need to disallow constant address space. BUILTIN(__builtin_amdgcn_div_scale, "dddbb*", "n") arsenm wrote: > Anastasia wrote: > > Do you plan to provide the suppor

[PATCH] D46651: [OpenCL] Support new/delete in Sema

2018-06-14 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/D46651 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

[PATCH] D47630: [Sema] Allow creating types with multiple of the same addrspace.

2018-06-15 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/D47630 ___ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman

[PATCH] D48419: [OpenCL] Fixed parsing of address spaces for C++

2018-06-21 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. Anastasia added a reviewer: yaxunl. Due to missing handling of address space tokens in parsing code of C++ we were unable to parse declarations that start from an address space keyword. For example we would get an error: test.cl:2:1: error: expected expression

[PATCH] D48438: [Sema] Updated note for address spaces to print the type.

2018-06-21 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia created this revision. Anastasia added a reviewer: yaxunl. This allows to reuse the same diagnostic for OpenCL or CUDA. For OpenCL this will be tested in `test/SemaOpenCL/address-spaces-conversions-cl2.0.cl` that I plan to enable with `-cl-std=c++` after fixing other issues. https:/

[PATCH] D48419: [OpenCL] Fixed parsing of address spaces for C++

2018-06-21 Thread Anastasia Stulova via Phabricator via cfe-commits
Anastasia added a comment. In https://reviews.llvm.org/D48419#1139601, @yaxunl wrote: > Did you notice the bug that C++ silently allows implicit casting of a pointer > to a pointer type with different address space? > > Do you have a fix for that? I didn't think it did because if I run `test

  1   2   3   4   5   6   7   8   9   10   >