[PATCH] D144634: [Clang][OpenMP] Support for Code Generation of loop bind clause

2023-08-04 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144634/new/ https://reviews.llvm.org/D144634 ___ cfe-commits mailing list cfe-commits@l

[PATCH] D157140: [clang][Sema][OpenMP] Fix capture region for 'target teams loop'

2023-08-05 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:15410 break; +case OMPD_target_teams_loop: + // This is equivalent to 'target teams distribute parallel for' with Need to have capture region for parallel, no? Repository:

[PATCH] D157197: [clang][CodeGen][OpenMP] Fix if-clause for 'target teams loop'

2023-08-05 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Add the reference to openmp spec Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157197/new/ https://reviews.llvm.org/D157197 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[PATCH] D157197: [clang][CodeGen][OpenMP] Fix if-clause for 'target teams loop'

2023-08-05 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGStmtOpenMP.cpp:1564 + // Any if-clause associated with expansion for 'target teams loop' should + // apply to target region only. OpenMP 5.2 [3.4, if Clause, Semantics, 15-18] + if (S.getDirectiveKind() != OMPD_tar

[PATCH] D157229: Fix edge case in declare target initializer expression

2023-08-07 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D157229/new/ https://reviews.llvm.org/D157229 ___

[PATCH] D152054: [OpenMP] Codegen support for thread_limit on target directive

2023-08-07 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152054/new/ https://reviews.llvm.org/D152054 ___

[PATCH] D152054: [OpenMP] Codegen support for thread_limit on target directive

2023-08-08 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Please, use the script to generate the checks for the newly added tests CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152054/new/ https://reviews.llvm.org/D152054 ___ cfe-commits mailing list cfe-commits@lists.llvm.or

[PATCH] D157197: [clang][CodeGen][OpenMP] Fix if-clause for 'target teams loop'

2023-08-08 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGStmtOpenMP.cpp:1570-1575 + // If we are here with a 'target teams loop' then we are emitting the + // 'parallel' region of the 'target teams distribute parallel for' + // emitted in place of the 'target teams loop'

[PATCH] D152054: [OpenMP] Codegen support for thread_limit on target directive

2023-08-09 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/test/OpenMP/target_parallel_for_simd_tl_codegen.cpp:4 + +// RUN: %clang_cc1 -fopenmp -fopenmp-version=51 -emit-llvm %s -o - | FileCheck --check-prefix=OMP51 %s + Add PCH serialization/desrialization checks in your

[PATCH] D123235: [OpenMP] atomic compare fail : Parser & AST support

2023-08-10 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/include/clang/AST/OpenMPClause.h:2320-2321 +: public OMPClause, + private llvm::TrailingObjects { + OMPClause *MemoryOrderClause; Why need tail-allocation here for constant number of attributes? They can

[PATCH] D153883: [Clang][OpenMP] Delay emission of __kmpc_alloc_shared for escaped VLAs

2023-06-30 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CodeGenFunction.h:2806 + /// Return true if all the emissions for the VLA size have occured. + bool hasVLASize(const VariableArrayType *type); + doru1004 wrote: > doru1004 wrote: > > doru1004 wrote: >

[PATCH] D153883: [Clang][OpenMP] Delay emission of __kmpc_alloc_shared for escaped VLAs

2023-06-30 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CodeGenFunction.h:2806 + /// Return true if all the emissions for the VLA size have occured. + bool hasVLASize(const VariableArrayType *type); + doru1004 wrote: > doru1004 wrote: > > ABataev wrote: >

[PATCH] D154180: [OPENMP52] Codegen support for doacross clause.

2023-07-03 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:11405-11406 + llvm::OpenMPIRBuilder &OMPBuilder = CGM.getOpenMPRuntime().getOMPBuilder(); + const OMPDependClause *DepC = dyn_cast(C); + const OMPDoacrossClause *DoC = dyn_cast(C); + if ((DoC &&

[PATCH] D153883: [Clang][OpenMP] Delay emission of __kmpc_alloc_shared for escaped VLAs

2023-07-03 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGDecl.cpp:1606 + CGOpenMPRuntimeGPU &RT = + *(static_cast(&CGM.getOpenMPRuntime())); + if (RT.isDelayedVariableLengthDecl(*this, &D)) { 1. use `static_cast(CGM.getOpenMPRuntime())` 2

[PATCH] D154180: [OPENMP52] Codegen support for doacross clause.

2023-07-03 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:11410 } else { -assert(C->getDependencyKind() == OMPC_DEPEND_sink); +assert(ODK.isSink(C)); RTLFn = OMPBuilder.getOrCreateRuntimeFunction(CGM.getModule(), Add a messa

[PATCH] D154180: [OPENMP52] Codegen support for doacross clause.

2023-07-03 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG with a nit Comment at: clang/lib/CodeGen/CGOpenMPRuntime.h:2285-2297 +return (C->getDependencyKind() == OMPC_DEPEND_sink); + } + bool isSource(const OMPDependClaus

[PATCH] D153883: [Clang][OpenMP] Delay emission of __kmpc_alloc_shared for escaped VLAs

2023-07-05 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGDecl.cpp:1606 + CGOpenMPRuntimeGPU &RT = + *(static_cast(&CGM.getOpenMPRuntime())); + if (RT.isDelayedVariableLengthDecl(*this, &D)) { ABataev wrote: > 1. use `static_cast(CGM.getOp

[PATCH] D153883: [Clang][OpenMP] Delay emission of __kmpc_alloc_shared for escaped VLAs

2023-07-05 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGDecl.cpp:1606 + CGOpenMPRuntimeGPU &RT = + *(static_cast(&CGM.getOpenMPRuntime())); + if (RT.isDelayedVariableLengthDecl(*this, &D)) { doru1004 wrote: > ABataev wrote: > > ABataev w

[PATCH] D153883: [Clang][OpenMP] Delay emission of __kmpc_alloc_shared for escaped VLAs

2023-07-05 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGDecl.cpp:591 + auto &RT = + *(static_cast(&CGF.CGM.getOpenMPRuntime())); + RT.getKmpcFreeShared(CGF, AddrSizePair); Same, just CGOpenMPRuntime &RT = CGM.getOpenMPRuntime(); ==

[PATCH] D153883: [Clang][OpenMP] Delay emission of __kmpc_alloc_shared for escaped VLAs

2023-07-06 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG with a nit Comment at: clang/lib/CodeGen/CGDecl.cpp:19 #include "CGOpenMPRuntime.h" +#include "CGOpenMPRuntimeGPU.h" #include "CodeGenFunction.h" You

[PATCH] D154556: [OPENMP52] Support Support omp_cur_iteration modifier for doacross clause.

2023-07-06 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/AST/OpenMPClause.cpp:2516-2523 + if (DepType == OMPC_DOACROSS_source) +OS << "source:"; + else if (DepType == OMPC_DOACROSS_sink) +OS << "sink:"; + else if (DepType == OMPC_DOACROSS_source_omp_cur_iteration) +OS

[PATCH] D154556: [OPENMP52] Support Support omp_cur_iteration modifier for doacross clause.

2023-07-06 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D154556/new/ https://reviews.llvm.org/D154556 ___

[PATCH] D154672: [OPENMP52] Deprecation of 'depend' clause in ordered directive.

2023-07-07 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/include/clang/Basic/DiagnosticParseKinds.td:1532 InGroup; +def warn_omp_depend_in_ordered_deprecated : Warning<"denpend clause for ordered is deprecated; use doacross instaed">, InGroup; denpend->depend insta

[PATCH] D144634: [Clang][OpenMP] Support for Code Generation of loop bind clause

2023-07-11 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:9838 +def err_omp_loop_reduction_clause : Error< + "reduction clause not allowed with '#pragma omp loop bind(teams)'">; def warn_break_binds_to_switch : Warning< 'reduct

[PATCH] D144634: [Clang][OpenMP] Support for Code Generation of loop bind clause

2023-07-14 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:9837 +def err_omp_bind_required_on_loop : Error< + "expected 'bind' clause for loop construct without an enclosing OpenMP " + "construct">; Also, `'loop'`

[PATCH] D144634: [Clang][OpenMP] Support for Code Generation of loop bind clause

2023-07-17 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:343 + /// This may also be used in a similar way for other constructs. + OpenMPDirectiveKind MappedDirective = OMPD_unknown; + ABataev wrote: > I assume it shall be a member of SharingMapT

[PATCH] D152054: [OpenMP] Codegen support for thread_limit on target directive

2023-08-24 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/test/OpenMP/target_parallel_for_simd_tl_codegen.cpp:30 +// OMP51-NEXT: entry: +// OMP51-NEXT:[[DOTGLOBAL_TID__ADDR_I:%.*]] = alloca i32, align 4 +// OMP51-NEXT:[[DOTPART_ID__ADDR_I:%.*]] = alloca ptr, align 8 -

[PATCH] D152054: [OpenMP] Codegen support for thread_limit on target directive

2023-08-24 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/test/OpenMP/target_parallel_for_simd_tl_codegen.cpp:30 +// OMP51-NEXT: entry: +// OMP51-NEXT:[[DOTGLOBAL_TID__ADDR_I:%.*]] = alloca i32, align 4 +// OMP51-NEXT:[[DOTPART_ID__ADDR_I:%.*]] = alloca ptr, align 8 -

[PATCH] D152054: [OpenMP] Codegen support for thread_limit on target directive

2023-08-24 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152054/new/ https://reviews.llvm.org/D152054 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[PATCH] D152054: [OpenMP] Codegen support for thread_limit on target directive

2023-08-25 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D152054/new/ https://reviews.llvm.org/D152054 ___ cfe-commits mailing list cfe-commits@lists.llvm.

[PATCH] D158778: [CUDA] Propagate __float128 support from the host.

2023-08-29 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D158778#4622901 , @tra wrote: > @ABataev > > This patch breaks breaks two tests: > > - > github.com/llvm/llvm-project/blob/main/clang/test/OpenMP/nvptx_unsupported_type_codegen.cpp > - > github.com/llvm/llvm-project/blob/main

[PATCH] D158266: [OpenMP] Patch for Support to loop bind clause : Checking Parent Region

2023-09-07 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D158266#4640416 , @koops wrote: > Can someone please review the changes that I uploaded last week? Still need to add extra tests to the nesting_of_regions.cpp test CHANGES SINCE LAST ACTION https://reviews.llvm.org/D158266

[PATCH] D138297: [Clang][OpenMP] Add default map type for target enter/exit data

2022-11-18 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Parse/ParseOpenMP.cpp:4367-4371 + if (getLangOpts().OpenMP >= 52) +if (DKind == OMPD_target_enter_data) + Data.ExtraModifier = OMPC_MAP_to; +else if (DKind == OMPD_target_exit_data) + Data

[PATCH] D138312: [OPENMP5.1] Initial support for message clause.

2022-11-18 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:11048 SeverityClauses.empty() ? nullptr : (*SeverityClauses.begin()); + auto MessageClauses = + OMPExecutableDirective::getClausesOfKind(Clauses); Use real type instead of auto

[PATCH] D138312: [OPENMP5.1] Initial support for message clause.

2022-11-18 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D138312/new/ https://reviews.llvm.org/D138312 ___

[PATCH] D138297: [Clang][OpenMP] Add default map type for target enter/exit data

2022-11-18 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG CHANGES SINCE LAST ACTION https://reviews.llvm.org/D138297/new/ https://reviews.llvm.org/D138297 ___ cfe-commits mailing list cfe-commits@l

[PATCH] D138780: [include-cleaner] Merge 2 parseIWYUPragma impls in libToolingInclusions

2022-11-28 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Looks like it breaks the build: llvm-project/clang-tools-extra/clangd/index/CanonicalIncludes.cpp: In member function ‘virtual bool clang::clangd::collectIWYUHeaderMaps(clang::clangd::CanonicalIncludes*)::PragmaCommentHandler::HandleComment(clang::Preprocessor&, clan

[PATCH] D138614: [Clang][OpenMP][AMDGPU] Fix capture of variably modified type alias in teams distribute

2022-11-29 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp:243 if (!FD->getType()->isReferenceType()) { - assert(!VD->getType()->isVariablyModifiedType() && + bool isVMT = VD->getType()->isVariablyModifiedType(); + asse

[PATCH] D138614: [Clang][OpenMP][AMDGPU] Fix capture of variably modified type alias in teams distribute

2022-11-29 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp:243 if (!FD->getType()->isReferenceType()) { - assert(!VD->getType()->isVariablyModifiedType() && + bool isVMT = VD->getType()->isVariablyModifiedType(); + asse

[PATCH] D138614: [Clang][OpenMP][AMDGPU] Fix capture of variably modified type alias in teams distribute

2022-11-29 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntimeGPU.cpp:243 if (!FD->getType()->isReferenceType()) { - assert(!VD->getType()->isVariablyModifiedType() && + bool isVMTTy = VD->getType()->isVariablyModifiedType(); + as

[PATCH] D74144: [OPENMP50]Add basic support for array-shaping operation.

2020-03-24 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Ping 7 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74144/new/ https://reviews.llvm.org/D74144 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[PATCH] D74144: [OPENMP50]Add basic support for array-shaping operation.

2020-03-25 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev marked an inline comment as done. ABataev added inline comments. Comment at: clang/lib/Sema/SemaExpr.cpp:4751 + LParenLoc, RParenLoc, Dims, Brackets); + if (!BaseTy->isAnyPointerType()) +return ExprError(Diag(Base->getExprLoc(),

[PATCH] D74144: [OPENMP50]Add basic support for array-shaping operation.

2020-03-25 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev marked 4 inline comments as done. ABataev added a comment. In D74144#1941971 , @rjmccall wrote: > Okay, so these array-shaping expressions are only allowed as operands to > specific OpenMP directives? That's a plausible interpretation of "The >

[PATCH] D74144: [OPENMP50]Add basic support for array-shaping operation.

2020-03-25 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev updated this revision to Diff 252700. ABataev added a comment. Rebase + fixes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74144/new/ https://reviews.llvm.org/D74144 Files: clang/include/clang-c/Index.h clang/include/clang/AST/ASTCon

[PATCH] D74144: [OPENMP50]Add basic support for array-shaping operation.

2020-03-26 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev updated this revision to Diff 252859. ABataev added a comment. Rebase + fixes. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74144/new/ https://reviews.llvm.org/D74144 Files: clang/include/clang-c/Index.h clang/include/clang/AST/ASTCon

[PATCH] D74144: [OPENMP50]Add basic support for array-shaping operation.

2020-03-30 Thread Alexey Bataev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG7ac9efb0c322: [OPENMP50]Add basic support for array-shaping operation. (authored by ABataev). Changed prior to commit: https://reviews.llvm.org/D74144?vs=252859&id=253584#toc Repository: rG LLVM Gith

[PATCH] D74144: [OPENMP50]Add basic support for array-shaping operation.

2020-02-19 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Herald added a subscriber: martong. Ping Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74144/new/ https://reviews.llvm.org/D74144 ___ cfe-commits mailing list cfe-commits@lists

[PATCH] D70172: [CUDA][HIP][OpenMP] Emit deferred diagnostics by a post-parsing AST travese

2020-02-19 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Seems to me, it causes some other issues. See https://bugs.llvm.org/show_bug.cgi?id=44948 for example Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D70172/new/ https://reviews.llvm.org/D70172

[PATCH] D74941: [OpenMP] `omp begin/end declare variant` - part 1, parsing

2020-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Parse/ParseOpenMP.cpp:1357-1359 + // Skip last tokens. + while (Tok.isNot(tok::annot_pragma_openmp_end)) +ConsumeAnyToken(); Better to emit a warning here about extra tokens at the end of the directive

[PATCH] D74970: [OpenMP] Refactor the analysis in checkMapClauseBaseExpression using StmtVisitor clause.

2020-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:15238 + Sema &SemaRef; + OpenMPClauseKind CKind; + OMPClauseMappableExprCommon::MappableExprComponentList &Components; Default initializer here Comment at: clang/lib/Se

[PATCH] D74970: [OpenMP] Refactor the analysis in checkMapClauseBaseExpression using StmtVisitor clause.

2020-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:15356 + Expr::EvalResult Result; + if (AE->getIdx()->EvaluateAsInt(Result, SemaRef.getASTContext())) { +if (!Result.Val.getInt().isNullValue()) { cchen wrote: > ABataev wro

[PATCH] D74970: [OpenMP] Refactor the analysis in checkMapClauseBaseExpression using StmtVisitor class.

2020-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:15319 } + return Visit(E); +} `return RelevantExpr || Visit(E);`? Comment at: clang/lib/Sema/SemaOpenMP.cpp:15346 } + return Visit(E); +} -

[PATCH] D74970: [OpenMP] Refactor the analysis in checkMapClauseBaseExpression using StmtVisitor class.

2020-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Did you try to run the tests? I would suggest adding a test, at least, where a function is mapped. We should see the error message here. Seems to me, we don't have this one. Comment at: clang/lib/Sema/SemaOpenMP.cpp:15422-15423 + Expr::EvalResult

[PATCH] D74970: [OpenMP] Refactor the analysis in checkMapClauseBaseExpression using StmtVisitor class.

2020-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D74970#1887246 , @cchen wrote: > In D74970#1887193 , @ABataev wrote: > > > Did you try to run the tests? I would suggest adding a test, at least, > > where a function is mapped. We shoul

[PATCH] D74970: [OpenMP] Refactor the analysis in checkMapClauseBaseExpression using StmtVisitor class.

2020-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:15358-15360 + if (!AE->getIdx()->isValueDependent()) +if (AE->getIdx()->EvaluateAsInt(Result, SemaRef.getASTContext())) { if (!Result.Val.getInt().isNullValue()) { Si

[PATCH] D74970: [OpenMP] Refactor the analysis in checkMapClauseBaseExpression using StmtVisitor class.

2020-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D74970#1887337 , @cchen wrote: > Fix test and sorry for my carelessness No problem. But I don't see the changes in the test. Comment at: clang/lib/Sema/SemaOpenMP.cpp:15473 + ERange)

[PATCH] D74941: [OpenMP] `omp begin/end declare variant` - part 1, parsing

2020-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D74941#1887381 , @kkwli0 wrote: > Since it is a TR8 feature, should we have this guarded by `-fopenmp-version=`? Not this one. It is required to fix the issues with math functions and should work for all versions of OpenMP. O

[PATCH] D74970: [OpenMP] Refactor the analysis in checkMapClauseBaseExpression using StmtVisitor class.

2020-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. Thanks, LGTM. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74970/new/ https://reviews.llvm.org/D74970

[PATCH] D74970: [OpenMP] Refactor the analysis in checkMapClauseBaseExpression using StmtVisitor class.

2020-02-21 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Sure. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74970/new/ https://reviews.llvm.org/D74970 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cg

[PATCH] D72857: [SYCL] Driver option to enable SYCL mode and select SYCL version

2020-02-22 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. If no other comments, LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D72857/new/ https://reviews.llvm.org/D72857 ___

[PATCH] D74970: [OpenMP] Refactor the analysis in checkMapClauseBaseExpression using StmtVisitor class.

2020-02-24 Thread Alexey Bataev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rGd66d25f83824: [OpenMP] Refactor the analysis in checkMapClauseBaseExpression using… (authored by cchen, committed by ABataev). Changed prior to commit: https://reviews.llvm.org/D74970?vs=245995&id=24621

[PATCH] D75077: [OpenMP5.0] Allow pointer arithmetic in motion/map clause

2020-02-24 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:7616 dyn_cast(I->getAssociatedExpression()); + const auto *UO = dyn_cast(I->getAssociatedExpression()); bool IsPointer = What about binary operator?

[PATCH] D75077: [OpenMP5.0] Allow pointer arithmetic in motion/map clause

2020-02-24 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:9965 "memory order clause '%0' is specified here">; +def err_omp_non_lvalue_in_map_or_motion_clauses: Error< + "expected lvalue with no function call in '#pragma omp target update' and

[PATCH] D75077: [OpenMP5.0] Allow pointer arithmetic in motion/map clause

2020-02-25 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:15683 } + bool VisitUnaryOperator(UnaryOperator *UO) { +if (SemaRef.getLangOpts().OpenMP < 50) { I think you need to extend this to support paren expressions, at least. ===

[PATCH] D75077: [OpenMP5.0] Allow pointer arithmetic in motion/map clause

2020-02-25 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:15683 } + bool VisitUnaryOperator(UnaryOperator *UO) { +if (SemaRef.getLangOpts().OpenMP < 50) { cchen wrote: > ABataev wrote: > > I think you need to extend this to support paren ex

[PATCH] D74144: [OPENMP50]Add basic support for array-shaping operation.

2020-02-25 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Ping 2 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D74144/new/ https://reviews.llvm.org/D74144 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/c

[PATCH] D75077: [OpenMP5.0] Allow pointer arithmetic in motion/map clause

2020-02-26 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:9965 "memory order clause '%0' is specified here">; +def err_omp_non_lvalue_in_map_or_motion_clauses: Error< + "expected lvalue with no function call in '#pragma omp target update' and

[PATCH] D75209: [OPENMP][NVPTX]Fix PR45003: add support for complex functions.

2020-02-26 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev created this revision. ABataev added reviewers: tra, hfinkel. Herald added a subscriber: guansong. Herald added a project: clang. Inherited support for complex math functions from CUDA implementation. Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D75209 Files: clang/

[PATCH] D75077: [OpenMP5.0] Allow pointer arithmetic in motion/map clause

2020-02-26 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/test/OpenMP/target_update_codegen.cpp:371-372 + // CK6-DAG: store i32* [[ADD_PTR:%.+]], i32** [[PC0]] + // CK6-DAG: [[ADD_PTR]] = getelementptr inbounds i32, i32* [[ONE:%.+]], i{{32|64}} [[IDX_EXT:%.+]] + // CK6-DAG: [[TWO:%.+]

[PATCH] D73967: Implement _ExtInt as an extended int type specifier.

2020-02-27 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/include/clang/AST/Type.h:6196 +// A fixed int type of a specified bitwidth. +class ExtIntType : public Type, public llvm::FoldingSetNode { Use `///` style Comment at: clang/include/clang/AST/Ty

[PATCH] D75077: [OpenMP5.0] Allow pointer arithmetic in motion/map clause

2020-02-27 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:15690 + return false; +if (!UO->isLValue()) { + emitErrorMsg(); Hmm, addr_of creates rvalues. Comment at: clang/lib/Sema/SemaOpenMP.cpp:15693 + return f

[PATCH] D75077: [OpenMP5.0] Allow pointer arithmetic in motion/map clause

2020-02-27 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/test/OpenMP/target_update_codegen.cpp:374 + // CK6-64-DAG: [[IDX_EXT]] = sext i32 [[TWO:%.+]] to i64 + // CK6-DAG: [[TWO:%.+]] = load i32, i32* [[L_ADDR:%.+]] + // CK6-DAG: store i32 [[L:%.+]], i32* [[L_ADDR]] c

[PATCH] D75077: [OpenMP5.0] Allow pointer arithmetic in motion/map clause

2020-02-27 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:15710 +// know the other subtree is just an offset) +assert(BO->getType()->isPointerType() && + "Expect the binary operator be pointer type"); cchen wrote: > cchen wrote: >

[PATCH] D75077: [OpenMP5.0] Allow pointer arithmetic in motion/map clause

2020-02-27 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:15684-15685 + bool VisitUnaryOperator(UnaryOperator *UO) { +if (SemaRef.getLangOpts().OpenMP < 50 || UO->getOpcode() != UO_Deref || +!UO->isLValue()) { + emitErrorMsg(); `U

[PATCH] D75077: [OpenMP5.0] Allow pointer arithmetic in motion/map clause

2020-02-27 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:15684-15685 + bool VisitUnaryOperator(UnaryOperator *UO) { +if (SemaRef.getLangOpts().OpenMP < 50 || UO->getOpcode() != UO_Deref || +!UO->isLValue()) { + emitErrorMsg(); AB

[PATCH] D75077: [OpenMP5.0] Allow pointer arithmetic in motion/map clause

2020-02-27 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Also, would be good to add more tests for the situations that should not be handled, like just `(a+b)`, explicit casts, etc. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:9966 +def err_omp_non_lvalue_in_map_or_motion_clauses: Error< + "

[PATCH] D75350: [OpenMP] Allow const parameters in declare simd linear clause

2020-02-28 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75350/new/ https://reviews.llvm.org/D75350 ___

[PATCH] D75077: [OpenMP5.0] Allow pointer arithmetic in motion/map clause

2020-02-28 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:15499-15501 RelevantExpr = DRE; // Record the component. Components.emplace_back(DRE, DRE->getDecl()); Shall we do this only if `RelevantExpr` is nullptr? C

[PATCH] D75077: [OpenMP5.0] Allow pointer arithmetic in motion/map clause

2020-02-28 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:15499-15501 RelevantExpr = DRE; // Record the component. Components.emplace_back(DRE, DRE->getDecl()); cchen wrote: > ABataev wrote: > > Shall we do this only if `RelevantExpr

[PATCH] D75077: [OpenMP5.0] Allow pointer arithmetic in motion/map clause

2020-02-28 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:15499-15501 RelevantExpr = DRE; // Record the component. Components.emplace_back(DRE, DRE->getDecl()); ABataev wrote: > cchen wrote: > > ABataev wrote: > > > Shall we do this

[PATCH] D75077: [OpenMP5.0] Allow pointer arithmetic in motion/map clause

2020-02-28 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75077/new/ https://reviews.llvm.org/D75077 _

[PATCH] D75077: [OpenMP5.0] Allow pointer arithmetic in motion/map clause

2020-02-28 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D75077#1898678 , @cchen wrote: > @ABataev, can you land it for me when you have time? > > Thanks, > Chi Chun Sure Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75077/new/ http

[PATCH] D75077: [OpenMP5.0] Allow pointer arithmetic in motion/map clause

2020-02-28 Thread Alexey Bataev via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG6ee6fa28a74e: [OpenMP5.0] Allow pointer arithmetic in motion/map clause, by Chi Chun Chen (authored by cchen, committed by ABataev). Changed prior to commit: https://reviews.llvm.org/D75077?vs=247303&id

[PATCH] D75223: [clang-offload-wrapper] Lower priority of __tgt_register_lib in favor of __tgt_register_requires

2020-03-03 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev accepted this revision. ABataev added a comment. This revision is now accepted and ready to land. LG Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D75223/new/ https://reviews.llvm.org/D75223 ___

[PATCH] D69204: [OpenMP 5.0] - Extend defaultmap

2019-10-30 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Some of the previous comments are not fixed. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:9100 +def note_omp_defaultmap_attr_none : Note< + "explicit data sharing attribute, data mapping attribute, or is_devise_ptr clause requested her

[PATCH] D69316: [OpenMP 5.0] target update list items need not be contiguous (Sema)

2019-10-31 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. What about codegen tests? Comment at: clang/test/OpenMP/target_update_ast_print.cpp:25 + U marr[10][10][10]; +#pragma omp target update to(marr[2][0:2][0:2]) + It seems to me, the tests are not updated. All non-contiguous tests must pa

[PATCH] D69204: [OpenMP 5.0] - Extend defaultmap

2019-11-01 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/include/clang/Basic/OpenMPKinds.def:426-436 +OPENMP_DEFAULTMAP_KIND(aggregate) +OPENMP_DEFAULTMAP_KIND(pointer) // Modifiers for 'defaultmap' clause. +OPENMP_DEFAULTMAP_MODIFIER(alloc) +OPENMP_DEFAULTMAP_MODIFIER(to) +OPENMP_DEF

[PATCH] D69204: [OpenMP 5.0] - Extend defaultmap

2019-11-01 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/include/clang/Basic/OpenMPKinds.def:426-436 +OPENMP_DEFAULTMAP_KIND(aggregate) +OPENMP_DEFAULTMAP_KIND(pointer) // Modifiers for 'defaultmap' clause. +OPENMP_DEFAULTMAP_MODIFIER(alloc) +OPENMP_DEFAULTMAP_MODIFIER(to) +OPENMP_DEF

[PATCH] D69785: [OpenMP] Introduce the OpenMP-IR-Builder

2019-11-04 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/include/clang/Basic/OpenMPKinds.h:23-24 enum OpenMPDirectiveKind { -#define OPENMP_DIRECTIVE(Name) \ - OMPD_##Name, #define OPENMP_DIRECTIVE_EXT(Name, Str) \ Better to make in a separate NFC patch. ===

[PATCH] D69785: [OpenMP] Introduce the OpenMP-IR-Builder

2019-11-04 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: llvm/include/llvm/IR/OpenMPIRBuilder.h:33 + /// IDs for all OpenMP directives. + enum DirektiveKind { +#define OMP_DIRECTIVE(Enum, ...) Enum, jdoerfert wrote: > ABataev wrote: > > 1. `DirectiveKind` > > 2. Is it possib

[PATCH] D69204: [OpenMP 5.0] - Extend defaultmap

2019-11-04 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Some comments marked as ]Вщту] are not done actually, check them, please. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:7246-7248 +// Set implicit behavior except for "default" for defaultmap +if ((Bits & OMP_MAP_IMPLICIT) && +(Impli

[PATCH] D69204: [OpenMP 5.0] - Extend defaultmap

2019-11-05 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:7246-7248 +// Set implicit behavior except for "default" for defaultmap +if ((Bits & OMP_MAP_IMPLICIT) && +(ImplicitBehavior != OMPC_DEFAULTMAP_MODIFIER_default)) { c

[PATCH] D69853: [OpenMP][NFCI] Introduce llvm/IR/OpenMPConstants.h

2019-11-05 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Basic/OpenMPKinds.cpp:408 OpenMPClauseKind CKind) { - assert(DKind <= OMPD_unknown); assert(CKind <= OMPC_unknown); Why assert is removed? Comment

[PATCH] D69785: [OpenMP] Introduce the OpenMP-IR-Builder

2019-11-05 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/include/clang/Driver/Options.td:1643 HelpText<"Emit OpenMP code only for SIMD-based constructs.">; +def fopenmp_new_codegen : Flag<["-"], "fopenmp-new-codegen">, Group, Flags<[CC1Option, NoArgumentUnused, HelpHidden]>, + HelpT

[PATCH] D69785: [OpenMP] Introduce the OpenMP-IR-Builder

2019-11-05 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Also, I think it would better to split LLVM part and clang part into separate patches. Comment at: llvm/include/llvm/IR/OpenMPIRBuilder.h:29 + /// not have an effect on \p M (see initialize). + OpenMPIRBuilder(Module &M) : M(M), Builder(M.getContext(

[PATCH] D69785: [OpenMP] Introduce the OpenMP-IR-Builder

2019-11-05 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D69785#1734292 , @jdoerfert wrote: > In D69785#1734205 , @ABataev wrote: > > > Also, I think it would better to split LLVM part and clang part into > > separate patches. > > > What do yo

[PATCH] D69853: [OpenMP][NFCI] Introduce llvm/IR/OpenMPConstants.h

2019-11-05 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Again, better to split into 2 patches, one for LLVM and one for clang. Comment at: clang/lib/Sema/SemaOpenMP.cpp:4011 unsigned NamedModifiersNumber = 0; - SmallVector FoundNameModifiers( - OMPD_unknown + 1); + SmallVector + FoundNameModifiers

[PATCH] D69853: [OpenMP][NFCI] Introduce llvm/IR/OpenMPConstants.h

2019-11-05 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:4011 unsigned NamedModifiersNumber = 0; - SmallVector FoundNameModifiers( - OMPD_unknown + 1); + SmallVector + FoundNameModifiers(unsigned(OMPD_unknown) + 1); jdoerfert wrote: > A

[PATCH] D69853: [OpenMP][NFCI] Introduce llvm/IR/OpenMPConstants.h

2019-11-05 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D69853#1734760 , @jdoerfert wrote: > In D69853#1734620 , @ABataev wrote: > > > Again, better to split into 2 patches, one for LLVM and one for clang. > > > I split the other patch, but th

[PATCH] D69853: [OpenMP][NFCI] Introduce llvm/IR/OpenMPConstants.h

2019-11-05 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/Sema/SemaOpenMP.cpp:4011 unsigned NamedModifiersNumber = 0; - SmallVector FoundNameModifiers( - OMPD_unknown + 1); + SmallVector + FoundNameModifiers(unsigned(OMPD_unknown) + 1); jdoerfert wrote: > A

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