[PATCH] D56326: [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive

2019-01-11 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked 11 inline comments as done. lildmh added a comment. Hi Alexey, Thanks a lot for the review! For 3 places I have doubt. Please see the comments inline. I tried to fix the rest of your comments. Comment at: lib/AST/DeclOpenMP.cpp:164 + if (NumClauses) { +Clau

[PATCH] D56326: [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive

2019-01-11 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 181289. lildmh marked an inline comment as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56326/new/ https://reviews.llvm.org/D56326 Files: include/clang/AST/DeclBase.h include/clang/AST/DeclCXX.h include/clang/AST/DeclOpenMP.h include/cl

[PATCH] D56326: [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive

2019-01-11 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/AST/DeclOpenMP.cpp:164 + if (NumClauses) { +Clauses = (OMPClause **)C.Allocate(sizeof(OMPClause *) * NumClauses); +setClauses(CL); ABataev wrote: > lildmh wrote: > > A

[PATCH] D56326: [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive

2019-01-11 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/AST/DeclOpenMP.cpp:164 + if (NumClauses) { +Clauses = (OMPClause **)C.Allocate(sizeof(OMPClause *) * NumClauses); +setClauses(CL); ABataev wrote: > lildmh wrote: > > A

[PATCH] D56326: [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive

2019-01-24 Thread Lingda Li via Phabricator via cfe-commits
lildmh added inline comments. Comment at: lib/AST/DeclOpenMP.cpp:164 + if (NumClauses) { +Clauses = (OMPClause **)C.Allocate(sizeof(OMPClause *) * NumClauses); +setClauses(CL); ABataev wrote: > lildmh wrote: > > ABataev wrote: > > > lildmh wrote: > > > >

[PATCH] D56326: [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive

2019-01-24 Thread Lingda Li via Phabricator via cfe-commits
lildmh added inline comments. Comment at: lib/AST/DeclOpenMP.cpp:164 + if (NumClauses) { +Clauses = (OMPClause **)C.Allocate(sizeof(OMPClause *) * NumClauses); +setClauses(CL); ABataev wrote: > lildmh wrote: > > ABataev wrote: > > > lildmh wrote: > > > >

[PATCH] D56326: [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive

2019-01-25 Thread Lingda Li via Phabricator via cfe-commits
lildmh added inline comments. Comment at: lib/AST/DeclOpenMP.cpp:164 + if (NumClauses) { +Clauses = (OMPClause **)C.Allocate(sizeof(OMPClause *) * NumClauses); +setClauses(CL); ABataev wrote: > lildmh wrote: > > ABataev wrote: > > > lildmh wrote: > > > >

[PATCH] D56326: [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive

2019-01-25 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 183570. lildmh added a comment. Change the type of mapper clause storage from OMPClause ** to MutableArrayRef, and rebase CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56326/new/ https://reviews.llvm.org/D56326 Files: include/clang/AST/DeclBase.h

[PATCH] D56326: [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive

2019-01-25 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked 18 inline comments as done. lildmh added a comment. Hi Alexey, Thanks a lot for the review! Tried to address all of your comments in the new diff. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56326/new/ https://reviews.llvm.org/D56326

[PATCH] D56326: [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive

2019-01-25 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 183615. lildmh added a comment. Address review comments and rebase CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56326/new/ https://reviews.llvm.org/D56326 Files: include/clang/AST/DeclBase.h include/clang/AST/DeclCXX.h include/clang/AST/DeclO

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-03-17 Thread Lingda Li via Phabricator via cfe-commits
lildmh created this revision. lildmh added reviewers: ABataev, hfinkel, Meinersbur, kkwli0. lildmh added a project: OpenMP. Herald added subscribers: cfe-commits, jdoerfert, guansong. Herald added a project: clang. This patch implements the code generation for OpenMP 5.0 declare mapper (user-defi

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-04-26 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 196880. lildmh added a comment. Combine 2 pointers into one. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59474/new/ https://reviews.llvm.org/D59474 Files: include/clang/AST/GlobalDecl.h lib/AST/ASTContext.cpp lib/CodeGen/CGDecl.cpp lib/Cod

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-04-26 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked 3 inline comments as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:2390 } + case OMPRTL__tgt_target_data_mapper: { +// Build void __tgt_target_data_mapper(int64_t device_id, int32_t arg_num, ABataev wrote: >

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-05-03 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked 7 inline comments as done. lildmh added a comment. Hi Alexey, Again, thanks for your review! Sorry I didn't get back to you in time because I was distracted by other things. Please see the comments inline. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:8021 + ///

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-05-03 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 198050. lildmh added a comment. Fix code format CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59474/new/ https://reviews.llvm.org/D59474 Files: include/clang/AST/GlobalDecl.h lib/AST/ASTContext.cpp lib/CodeGen/CGDecl.cpp lib/CodeGen/CGOpenMP

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-05-03 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked 3 inline comments as done. lildmh added a comment. Hi Alexey, Let's discuss your runtime data mapping scheme next week first. After that we will continue the review of this. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:8530 + // dynamically. + QualType

[PATCH] D56326: [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive

2019-02-01 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 184740. lildmh added a comment. Herald added a subscriber: openmp-commits. Rebase. Hi Alexey, Thanks a lot for the review! It seems no one else will review it. If you think it's ready to go, could you please accept this patch? I also need help to commit thi

[PATCH] D56326: [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive

2019-02-01 Thread Lingda Li via Phabricator via cfe-commits
lildmh added a comment. Thanks a lot Alexey! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D56326/new/ https://reviews.llvm.org/D56326 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cf

[PATCH] D56326: [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive

2019-02-01 Thread Lingda Li via Phabricator via cfe-commits
lildmh added a comment. In D56326#1381229 , @Meinersbur wrote: > @lildmh Thanks for the patch. I can commit this patch for you. The tests run > fine on my machine. However, for committing on other's behalf, we were asked > to make the contributor aware t

[PATCH] D58074: [OpenMP 5.0] Parsing/sema support for map clause with mapper modifier

2019-02-11 Thread Lingda Li via Phabricator via cfe-commits
lildmh created this revision. lildmh added reviewers: ABataev, hfinkel, Meinersbur. lildmh added a project: OpenMP. Herald added subscribers: cfe-commits, guansong. Herald added a project: clang. This patch implements the parsing and sema support for OpenMP map clauses with potential user-defined

[PATCH] D58074: [OpenMP 5.0] Parsing/sema support for map clause with mapper modifier

2019-02-11 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 186338. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58074/new/ https://reviews.llvm.org/D58074 Files: include/clang/AST/OpenMPClause.h include/clang/Basic/DiagnosticParseKinds.td include/clang/Basic/DiagnosticSemaKinds.td include/clang/Basic

[PATCH] D58074: [OpenMP 5.0] Parsing/sema support for map clause with mapper modifier

2019-02-12 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked 11 inline comments as done. lildmh added a comment. Hi Alexey, Thanks very much for your quick review! For the codegen, currently I'm thinking to do it within declare target codegen functions. So there is not a very clear interface to do mapper codegen (also, there is not a clear

[PATCH] D58074: [OpenMP 5.0] Parsing/sema support for map clause with mapper modifier

2019-02-12 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 186492. lildmh marked 3 inline comments as done. lildmh added a comment. Fix part of Alexey's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58074/new/ https://reviews.llvm.org/D58074 Files: include/clang/AST/OpenMPClause.h include/clang

[PATCH] D58074: [OpenMP 5.0] Parsing/sema support for map clause with mapper modifier

2019-02-12 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked 2 inline comments as done. lildmh added inline comments. Comment at: include/clang/AST/OpenMPClause.h:4236 + static OMPMapClause * + Create(const ASTContext &C, SourceLocation StartLoc, SourceLocation LParenLoc, + SourceLocation EndLoc, ArrayRef Vars, ---

[PATCH] D58074: [OpenMP 5.0] Parsing/sema support for map clause with mapper modifier

2019-02-12 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/Sema/SemaLookup.cpp:1074 + if (NameKind == LookupOMPMapperName) { +// Skip out-of-scope declarations. ABataev wrote: > lildmh wrote: > > ABataev wrote: > > > lildmh wrot

[PATCH] D58074: [OpenMP 5.0] Parsing/sema support for map clause with mapper modifier

2019-02-12 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/Sema/SemaLookup.cpp:1074 + if (NameKind == LookupOMPMapperName) { +// Skip out-of-scope declarations. ABataev wrote: > lildmh wrote: > > ABataev wrote: > > > lildmh wrot

[PATCH] D58074: [OpenMP 5.0] Parsing/sema support for map clause with mapper modifier

2019-02-13 Thread Lingda Li via Phabricator via cfe-commits
lildmh added a reviewer: kkwli0. lildmh marked 4 inline comments as done. lildmh added inline comments. Comment at: lib/Parse/ParseOpenMP.cpp:2144 +parseMapType(*this, Data); } if (Data.MapType == OMPC_MAP_unknown) { kkwli0 wrote: > Although it

[PATCH] D58074: [OpenMP 5.0] Parsing/sema support for map clause with mapper modifier

2019-02-13 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 186742. lildmh added a comment. 1. Move mapper related info to `OMPMappableExprListClause`, so that `to` and `from` clauses can utilize the same infrastructure as well (real support for them will be in another patch); 2. Combine the function parameters for `d

[PATCH] D58074: [OpenMP 5.0] Parsing/sema support for map clause with mapper modifier

2019-02-14 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added a comment. Hi Alexey, Again thanks for your review! The codegen completely ignores any mapper related info for now, so it should not crash map clause codegen. It also passed the regression test, so map clause codegen should be fine. =

[PATCH] D58074: [OpenMP 5.0] Parsing/sema support for map clause with mapper modifier

2019-02-14 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added a comment. Sure I'll add a codegen test with mapper. Thanks! Comment at: include/clang/AST/OpenMPClause.h:4193 ArrayRef MapModifiersLoc, +NestedNameSpecifierLoc MapperQualifie

[PATCH] D58074: [OpenMP 5.0] Parsing/sema support for map clause with mapper modifier

2019-02-14 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 186912. lildmh added a comment. Introduce a structure `OMPMappableExprListSizeTy` within `OMPMappableExprListClause` to aggregate all 4 sizes needed by such clause, and thus reduce the number of parameters when creating a map clause. This can also be used by

[PATCH] D58074: [OpenMP 5.0] Parsing/sema support for map clause with mapper modifier

2019-02-15 Thread Lingda Li via Phabricator via cfe-commits
lildmh added inline comments. Comment at: include/clang/AST/OpenMPClause.h:3682-3685 + OpenMPClauseKind K, SourceLocation StartLoc, SourceLocation LParenLoc, + SourceLocation EndLoc, OMPMappableExprListSizeTy Sizes, + NestedNameSpecifierLoc *MapperQualifierLocP = n

[PATCH] D58523: [OpenMP 5.0] Parsing/sema support for to and from clauses with mapper modifier

2019-02-21 Thread Lingda Li via Phabricator via cfe-commits
lildmh created this revision. lildmh added reviewers: ABataev, hfinkel, Meinersbur, kkwli0. lildmh added a project: OpenMP. Herald added subscribers: cfe-commits, jdoerfert, guansong. Herald added a project: clang. This patch implements the parsing and sema support for OpenMP to and from clauses

[PATCH] D58523: [OpenMP 5.0] Parsing/sema support for to and from clauses with mapper modifier

2019-02-21 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked 12 inline comments as done. lildmh added inline comments. Comment at: lib/AST/OpenMPClause.cpp:1469 void OMPClausePrinter::VisitOMPFromClause(OMPFromClause *Node) { if (!Node->varlist_empty()) { ABataev wrote: > Better to split this patch into

[PATCH] D58523: [OpenMP 5.0] Parsing/sema support for to and from clauses with mapper modifier

2019-02-21 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 187869. lildmh marked 3 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58523/new/ https://reviews.llvm.org/D58523 Files: include/clang/AST/OpenMPClause.h include/clang/Basic/DiagnosticParseKinds.td include/clang/Basic/Ope

[PATCH] D58523: [OpenMP 5.0] Parsing/sema support for to clause with mapper modifier

2019-02-22 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 187958. lildmh retitled this revision from "[OpenMP 5.0] Parsing/sema support for to and from clauses with mapper modifier" to "[OpenMP 5.0] Parsing/sema support for to clause with mapper modifier". lildmh edited the summary of this revision. lildmh added a co

[PATCH] D58523: [OpenMP 5.0] Parsing/sema support for to clause with mapper modifier

2019-02-22 Thread Lingda Li via Phabricator via cfe-commits
lildmh added inline comments. Comment at: lib/Sema/SemaOpenMP.cpp:13195 - } else { -MVLI.UDMapperList.push_back(nullptr); } ABataev wrote: > Is this correct for `from` clause? Yes, it's correct for `from`, which will never use `MVLI.UDMapperLi

[PATCH] D58523: [OpenMP 5.0] Parsing/sema support for to clause with mapper modifier

2019-02-22 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 187964. lildmh marked 4 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58523/new/ https://reviews.llvm.org/D58523 Files: include/clang/AST/OpenMPClause.h include/clang/Basic/DiagnosticParseKinds.td include/clang/Basic/Ope

[PATCH] D58523: [OpenMP 5.0] Parsing/sema support for to clause with mapper modifier

2019-02-22 Thread Lingda Li via Phabricator via cfe-commits
lildmh added a comment. Thanks a lot! CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58523/new/ https://reviews.llvm.org/D58523 ___ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commi

[PATCH] D58523: [OpenMP 5.0] Parsing/sema support for to clause with mapper modifier

2019-02-22 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 187970. lildmh added a comment. Rebase CHANGES SINCE LAST ACTION https://reviews.llvm.org/D58523/new/ https://reviews.llvm.org/D58523 Files: include/clang/AST/OpenMPClause.h include/clang/Basic/DiagnosticParseKinds.td include/clang/Basic/OpenMPKinds

[PATCH] D58638: [OpenMP 5.0] Parsing/sema support for from clause with mapper modifier

2019-02-25 Thread Lingda Li via Phabricator via cfe-commits
lildmh created this revision. lildmh added reviewers: ABataev, hfinkel, Meinersbur, kkwli0. lildmh added a project: OpenMP. Herald added subscribers: cfe-commits, jdoerfert, guansong. Herald added a project: clang. This patch implements the parsing and sema support for OpenMP from clause with pot

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-03 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 202790. lildmh edited the summary of this revision. lildmh added a comment. Implement the new mapper codegen scheme CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59474/new/ https://reviews.llvm.org/D59474 Files: include/clang/AST/GlobalDecl.h li

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-04 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 202926. lildmh added a comment. Address Alexey's comment about mapping between function and user-defined mappers CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59474/new/ https://reviews.llvm.org/D59474 Files: include/clang/AST/GlobalDecl.h lib/A

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-06 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 203438. lildmh added a comment. Use __tgt instead of __kmpc for mapper runtime function names CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59474/new/ https://reviews.llvm.org/D59474 Files: include/clang/AST/GlobalDecl.h lib/AST/ASTContext.cpp

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-10 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:8729 +/// \code +/// void .omp_mapper...(void *rt_mapper_handle, +/// void *base, void *begin, ABataev wro

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-10 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:8729 +/// \code +/// void .omp_mapper...(void *rt_mapper_handle, +/// void *base, void *begin, ABataev wro

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-10 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:8729 +/// \code +/// void .omp_mapper...(void *rt_mapper_handle, +/// void *base, void *begin, ABataev wro

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-10 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:8729 +/// \code +/// void .omp_mapper...(void *rt_mapper_handle, +/// void *base, void *begin, ABataev wro

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-19 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 205647. lildmh marked 3 inline comments as done. lildmh added a comment. Fix mapper function name mangling CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59474/new/ https://reviews.llvm.org/D59474 Files: include/clang/AST/GlobalDecl.h lib/AST/AST

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-19 Thread Lingda Li via Phabricator via cfe-commits
lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:8739 +/// // For each component specified by this mapper: +/// if (currentComponent.hasMapper()) +/// (*currentComponent.Mapper())(rt_mapper_handle, arg_base, arg_begin, ABata

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-20 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 205785. lildmh marked 9 inline comments as done. lildmh added a comment. Address Alexey's comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59474/new/ https://reviews.llvm.org/D59474 Files: include/clang/AST/GlobalDecl.h lib/AST/ASTContext.

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-20 Thread Lingda Li via Phabricator via cfe-commits
lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:8739 +/// // For each component specified by this mapper: +/// if (currentComponent.hasMapper()) +/// (*currentComponent.Mapper())(rt_mapper_handle, arg_base, arg_begin, ABata

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-07-17 Thread Lingda Li via Phabricator via cfe-commits
lildmh added a comment. In D59474#1589464 , @ABataev wrote: > In D59474#1561161 , @lildmh wrote: > > > Change the type of size from `size_t` to `int64_t`, and rebase > > > Lingda, could you rebase it again? Thanks.

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-07-23 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 211278. lildmh added a comment. Herald added a reviewer: jdoerfert. Rebase CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59474/new/ https://reviews.llvm.org/D59474 Files: include/clang/AST/GlobalDecl.h lib/AST/ASTContext.cpp lib/CodeGen/CGDecl

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-07-23 Thread Lingda Li via Phabricator via cfe-commits
lildmh added inline comments. Comment at: lib/CodeGen/CGDecl.cpp:2533 + CodeGenFunction *CGF) { + if (!LangOpts.OpenMP || LangOpts.OpenMPSimd || + (!LangOpts.EmitAllDecls && !D->isUsed())) ABataev wrote: > Why do we n

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-07-23 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 211333. lildmh marked 4 inline comments as done. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59474/new/ https://reviews.llvm.org/D59474 Files: include/clang/AST/GlobalDecl.h lib/AST/ASTContext.cpp lib/CodeGen/CGDecl.cpp lib/CodeGen/CGOpenMPR

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-07-23 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked 3 inline comments as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:7116-7124 + /// Get the offset of the OMP_MAP_MEMBER_OF field. + static unsigned getFlagMemberOffset() { +unsigned Offset = 0; +for (uint64_t Remain = OMP_

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-07-24 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 211589. lildmh added a comment. Get rid of MSVC requirement of this, and a virtual function CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59474/new/ https://reviews.llvm.org/D59474 Files: include/clang/AST/GlobalDecl.h lib/AST/ASTContext.cpp l

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-07-25 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.h:2110 + /// Emit code for the user defined mapper construct. + void emitUserDefinedMapper(const OMPDeclareMapperDecl *D, + CodeGenFunction

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-07-25 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.h:2110 + /// Emit code for the user defined mapper construct. + void emitUserDefinedMapper(const OMPDeclareMapperDecl *D, + CodeGenFunction

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-07-25 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.h:2110 + /// Emit code for the user defined mapper construct. + void emitUserDefinedMapper(const OMPDeclareMapperDecl *D, + CodeGenFunction

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-07-25 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 211794. lildmh added a comment. Remove virtual from function declaration CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59474/new/ https://reviews.llvm.org/D59474 Files: include/clang/AST/GlobalDecl.h lib/AST/ASTContext.cpp lib/CodeGen/CGDecl.c

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-07-26 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.h:815 + /// code generation. + void emitUDMapperArrayInitOrDel(CodeGenFunction &MapperCGF, + llvm::Value *Handle, llvm::Value *BasePtr

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-07-26 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 211991. lildmh added a comment. Make `emitUDMapperArrayInitOrDel` private CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59474/new/ https://reviews.llvm.org/D59474 Files: include/clang/AST/GlobalDecl.h lib/AST/ASTContext.cpp lib/CodeGen/CGDecl.

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-07-29 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added a comment. Thanks Alexey! Could you look into the runtime patch D60972 then? Comment at: test/OpenMP/declare_mapper_codegen.cpp:44-48 +// CK0-DAG: store i8* %0, i8** [[HANDLEADDR:%[^,]+]] +

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-07-29 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: test/OpenMP/declare_mapper_codegen.cpp:44-48 +// CK0-DAG: store i8* %0, i8** [[HANDLEADDR:%[^,]+]] +// CK0-DAG: store i8* %1, i8** [[BPTRADDR:%[^,]+]] +// CK0-DAG: store i8* %2, i8** [[VPTRADDR:%[^

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-07-29 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: test/OpenMP/declare_mapper_codegen.cpp:44-48 +// CK0-DAG: store i8* %0, i8** [[HANDLEADDR:%[^,]+]] +// CK0-DAG: store i8* %1, i8** [[BPTRADDR:%[^,]+]] +// CK0-DAG: store i8* %2, i8** [[VPTRADDR:%[^

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-07-30 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 212399. lildmh marked an inline comment as done. lildmh added a comment. Change mapper function argument checking CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59474/new/ https://reviews.llvm.org/D59474 Files: include/clang/AST/GlobalDecl.h lib/

[PATCH] D56326: [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive

2019-08-02 Thread Lingda Li via Phabricator via cfe-commits
lildmh added a comment. Hi David, An extra bit is needed to be added to `IdentifierNamespace`, and I could not find another field to shrink its width. As a result, it ends up larger than a word now. If you have a better solution, I'll be happy to know. Thanks, Lingda Repository: rC Clang

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-08-05 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 213339. lildmh added a comment. Fix declare mapper codegen test when the function argument has name attached. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59474/new/ https://reviews.llvm.org/D59474 Files: include/clang/AST/GlobalDecl.h lib/AST/

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-25 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:8739 +/// // For each component specified by this mapper: +/// if (currentComponent.hasMapper()) +/// (*currentComponent.Mapper())(rt_mapper_handle, ar

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-25 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked 4 inline comments as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:8739 +/// // For each component specified by this mapper: +/// if (currentComponent.hasMapper()) +/// (*currentComponent.Mapper())(rt_mapper_handle, ar

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-25 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked 2 inline comments as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:744 OMPRTL__tgt_target_data_update_nowait, + // Call to int64_t __tgt_mapper_num_components(void *rt_mapper_handle); + OMPRTL__tgt_mapper_num_components, --

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-25 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 206527. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59474/new/ https://reviews.llvm.org/D59474 Files: include/clang/AST/GlobalDecl.h lib/AST/ASTContext.cpp lib/CodeGen/CGDecl.cpp lib/CodeGen/CGOpenMPRuntime.cpp lib/CodeGen/CGOpenMPRuntime.

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-26 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:8739 +/// // For each component specified by this mapper: +/// if (currentComponent.hasMapper()) +/// (*currentComponent.Mapper())(rt_mapper_handle, ar

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-26 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:744 OMPRTL__tgt_target_data_update_nowait, + // Call to int64_t __tgt_mapper_num_components(void *rt_mapper_handle); + OMPRTL__tgt_mapper_num_components, --

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-26 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked 2 inline comments as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:8739 +/// // For each component specified by this mapper: +/// if (currentComponent.hasMapper()) +/// (*currentComponent.Mapper())(rt_mapper_handle, ar

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-26 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked 2 inline comments as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:8739 +/// // For each component specified by this mapper: +/// if (currentComponent.hasMapper()) +/// (*currentComponent.Mapper())(rt_mapper_handle, ar

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-26 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:8739 +/// // For each component specified by this mapper: +/// if (currentComponent.hasMapper()) +/// (*currentComponent.Mapper())(rt_mapper_handle, ar

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-26 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:8739 +/// // For each component specified by this mapper: +/// if (currentComponent.hasMapper()) +/// (*currentComponent.Mapper())(rt_mapper_handle, ar

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-27 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:8739 +/// // For each component specified by this mapper: +/// if (currentComponent.hasMapper()) +/// (*currentComponent.Mapper())(rt_mapper_handle, ar

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-27 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:8739 +/// // For each component specified by this mapper: +/// if (currentComponent.hasMapper()) +/// (*currentComponent.Mapper())(rt_mapper_handle, ar

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-27 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:8739 +/// // For each component specified by this mapper: +/// if (currentComponent.hasMapper()) +/// (*currentComponent.Mapper())(rt_mapper_handle, ar

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-27 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:8739 +/// // For each component specified by this mapper: +/// if (currentComponent.hasMapper()) +/// (*currentComponent.Mapper())(rt_mapper_handle, ar

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-27 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:8739 +/// // For each component specified by this mapper: +/// if (currentComponent.hasMapper()) +/// (*currentComponent.Mapper())(rt_mapper_handle, ar

[PATCH] D59474: [OpenMP 5.0] Codegen support for user-defined mappers

2019-06-27 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 206895. lildmh added a comment. Change the type of size from `size_t` to `int64_t`, and rebase CHANGES SINCE LAST ACTION https://reviews.llvm.org/D59474/new/ https://reviews.llvm.org/D59474 Files: include/clang/AST/GlobalDecl.h lib/AST/ASTContext.cpp

[PATCH] D56326: [OpenMP 5.0] Parsing/sema support for "omp declare mapper" directive

2019-01-04 Thread Lingda Li via Phabricator via cfe-commits
lildmh created this revision. Herald added subscribers: cfe-commits, jfb, arphaman, guansong, jholewinski. Repository: rC Clang https://reviews.llvm.org/D56326 Files: include/clang/AST/DeclBase.h include/clang/AST/DeclCXX.h include/clang/AST/DeclOpenMP.h include/clang/AST/RecursiveASTV

[PATCH] D67833: [OpenMP 5.0] Codegen support to pass user-defined mapper functions to runtime

2019-09-20 Thread Lingda Li via Phabricator via cfe-commits
lildmh created this revision. Herald added subscribers: cfe-commits, guansong. Herald added a reviewer: jdoerfert. Herald added a project: clang. This patch implements the code generation to use OpenMP 5.0 declare mapper (e.g., user-defined mapper) constructs. It looks up the proper mapper functi

[PATCH] D67978: [OpenMP 5.0] Fix user-defined mapper lookup in sema for arrays

2019-09-24 Thread Lingda Li via Phabricator via cfe-commits
lildmh created this revision. lildmh added reviewers: ABataev, Meinersbur, hfinkel, jdoerfert. lildmh added a project: OpenMP. Herald added subscribers: cfe-commits, guansong. Herald added a project: clang. This patches fixes the case when a user-defined mapper is attached to the elements of an a

[PATCH] D67833: [OpenMP 5.0] Codegen support to pass user-defined mapper functions to runtime

2019-09-24 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 221578. CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67833/new/ https://reviews.llvm.org/D67833 Files: include/clang/AST/OpenMPClause.h lib/CodeGen/CGOpenMPRuntime.cpp lib/CodeGen/CGOpenMPRuntime.h lib/CodeGen/CGStmtOpenMP.cpp lib/CodeGen/C

[PATCH] D67978: [OpenMP 5.0] Fix user-defined mapper lookup in sema for arrays

2019-09-24 Thread Lingda Li via Phabricator via cfe-commits
lildmh added a comment. Without this patch, it cannot recognize array with mapper, for instance, `#pragma omp target map(mapper(a),to: arr[0:2])` won't work without this patch. Repository: rC Clang CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67978/new/ https://reviews.llvm.org/D67

[PATCH] D67978: [OpenMP 5.0] Fix user-defined mapper lookup in sema for arrays

2019-09-24 Thread Lingda Li via Phabricator via cfe-commits
lildmh added a comment. In D67978#1681319 , @ABataev wrote: > In D67978#1681318 , @lildmh wrote: > > > Without this patch, it cannot recognize array with mapper, for instance, > > `#pragma omp target map(mapper(a),

[PATCH] D67978: [OpenMP 5.0] Fix user-defined mapper lookup in sema for arrays

2019-09-24 Thread Lingda Li via Phabricator via cfe-commits
lildmh added a comment. In D67978#1681388 , @ABataev wrote: > In D67978#1681333 , @lildmh wrote: > > > In D67978#1681319 , @ABataev wrote: > > > > > In D67978#1681318

[PATCH] D67978: [OpenMP 5.0] Fix user-defined mapper lookup in sema for arrays

2019-09-25 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added a comment. HI Alexey, the ast print test is already there. Because I didn't check the mapper for array type before, such code will always not report any error, and ast print test is correct. Codegen test belongs to the other patch I released.

[PATCH] D67978: [OpenMP 5.0] Fix user-defined mapper lookup in sema for arrays

2019-09-26 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added a comment. In D67978#1683166 , @ABataev wrote: > In D67978#1683146 , @lildmh wrote: > > > HI Alexey, the ast print test is already there. Because I didn't check

[PATCH] D67978: [OpenMP 5.0] Fix user-defined mapper lookup in sema for arrays

2019-09-26 Thread Lingda Li via Phabricator via cfe-commits
lildmh added a comment. In D67978#1684169 , @ABataev wrote: > In D67978#1684104 , @lildmh wrote: > > > In D67978#1683166 , @ABataev wrote: > > > > > In D67978#1683146

[PATCH] D67978: [OpenMP 5.0] Fix user-defined mapper lookup in sema

2019-09-26 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 221990. lildmh retitled this revision from "[OpenMP 5.0] Fix user-defined mapper lookup in sema for arrays" to "[OpenMP 5.0] Fix user-defined mapper lookup in sema". lildmh edited the summary of this revision. CHANGES SINCE LAST ACTION https://reviews.llvm.o

[PATCH] D67978: [OpenMP 5.0] Fix user-defined mapper lookup in sema

2019-09-26 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 221991. lildmh added a comment. Fix mapper type checking CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67978/new/ https://reviews.llvm.org/D67978 Files: lib/Sema/SemaOpenMP.cpp test/OpenMP/declare_mapper_messages.c test/OpenMP/declare_mapper_m

[PATCH] D67978: [OpenMP 5.0] Fix user-defined mapper lookup in sema

2019-09-26 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/Sema/SemaOpenMP.cpp:14805 + if (!Type->isStructureOrClassType() && !Type->isUnionType() && + (MapperIdScopeSpec.isSet() || MapperId.getAsString() != "default")) { +SemaRef.Diag(Loc, d

[PATCH] D67978: [OpenMP 5.0] Fix user-defined mapper lookup in sema

2019-09-26 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: lib/Sema/SemaOpenMP.cpp:14805 + if (!Type->isStructureOrClassType() && !Type->isUnionType() && + (MapperIdScopeSpec.isSet() || MapperId.getAsString() != "default")) { +SemaRef.Diag(Loc, d

  1   2   >