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

2020-07-23 Thread Lingda Li via Phabricator via cfe-commits
lildmh added a comment. Can you check if https://reviews.llvm.org/D84470 fixes the problem as this test doesn't work on my machine? If yes, please accept and upstream it since I don't have the permission. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2020-07-22 Thread Joachim Protze via Phabricator via cfe-commits
protze.joachim added a comment. I'm executing: $ /usr/bin/python bin/llvm-lit -vv -a projects/openmp/libomptarget/test/offloading/target_depend_nowait.cpp which executes: "/dev/shm/jprotze/build-tsan-fiber-as/./bin/clang++" "-fopenmp" "-pthread" "-fno-experimental-isel" "-I"

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

2020-07-22 Thread Lingda Li via Phabricator via cfe-commits
lildmh added a comment. I couldn't reproduce this problem because all commands are ignored on my machine. Could you send the exact compiling and running commands? In the IR files you sent me before, any idea where segfault happens? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST

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

2020-07-22 Thread Lingda Li via Phabricator via cfe-commits
lildmh added a comment. In D67833#2166478 , @protze.joachim wrote: > Starting with the commit of this patch, the libomptarget test > `llvm-project/openmp/libomptarget/test/offloading/target_depend_nowait.cpp` > fails. Here is a stacktrace of the

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

2020-07-22 Thread Joachim Protze via Phabricator via cfe-commits
protze.joachim added a comment. Starting with the commit of this patch, the libomptarget test `llvm-project/openmp/libomptarget/test/offloading/target_depend_nowait.cpp` fails. Here is a stacktrace of the segfault: $ gdb target_depend_nowait.cpp.tmp-x86_64-pc-linux-gnu (gdb) run ...

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

2020-07-20 Thread Lingda Li via Phabricator via cfe-commits
lildmh added a comment. In D67833#2161241 , @Meinersbur wrote: > Seems that it already has been applied ;-) Yes, thanks Michael. Hope everything goes well with you Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2020-07-19 Thread Michael Kruse via Phabricator via cfe-commits
Meinersbur added a comment. Seems that it already has been applied ;-) Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67833/new/ https://reviews.llvm.org/D67833 ___ cfe-commits mailing list

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

2020-07-16 Thread Lingda Li via Phabricator via cfe-commits
lildmh added a comment. Fix is at https://reviews.llvm.org/D83959 @Meinersbur Michael, could you please help upstream the patch above? Thanks Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67833/new/ https://reviews.llvm.org/D67833

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

2020-07-16 Thread Lingda Li via Phabricator via cfe-commits
lildmh added a comment. In D67833#2155196 , @fhahn wrote: > I think this change introduced the following warnings, where `auto &` is used > for types that are always copied. It would be great if you could take a look. > >

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

2020-07-16 Thread Florian Hahn via Phabricator via cfe-commits
fhahn added a comment. I think this change introduced the following warnings, where `auto &` is used for types that are always copied. It would be great if you could take a look. lvm-project/clang/lib/CodeGen/CGOpenMPRuntime.cpp:8011:24: warning: loop variable 'L' is always a copy because

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

2020-07-15 Thread George Rokos via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG537b16e9b8da: [OpenMP 5.0] Codegen support to pass user-defined mapper functions to runtime (authored by grokos). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2020-07-15 Thread George Rokos via Phabricator via cfe-commits
grokos added a comment. OK, now it works. Thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67833/new/ https://reviews.llvm.org/D67833 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2020-07-15 Thread Lingda Li via Phabricator via cfe-commits
lildmh added a comment. In D67833#2154312 , @grokos wrote: > I tried to build clang with this patch and I get errors like: > > CGOpenMPRuntime.cpp:9463:38: error: > ‘OMPRTL___tgt_target_teams_nowait_mapper’ was not declared in this scope >

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

2020-07-15 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 278344. lildmh added a comment. Herald added a project: LLVM. Herald added a subscriber: llvm-commits. Include the llvm part CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67833/new/ https://reviews.llvm.org/D67833 Files:

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

2020-07-15 Thread George Rokos via Phabricator via cfe-commits
grokos added a comment. I tried to build clang with this patch and I get errors like: CGOpenMPRuntime.cpp:9463:38: error: ‘OMPRTL___tgt_target_teams_nowait_mapper’ was not declared in this scope ? OMPRTL___tgt_target_teams_nowait_mapper Where are these

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

2020-07-15 Thread Lingda Li via Phabricator via cfe-commits
lildmh added a comment. @grokos Could you upstream this patch and the runtime patch neck to neck? Upstreaming one of them will break the OpenMP offloading. It will be nice if you can test this patch locally with the runtime patch. Thanks CHANGES SINCE LAST ACTION

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

2020-07-15 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/D67833/new/ https://reviews.llvm.org/D67833 ___ cfe-commits mailing list

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

2020-07-15 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 278291. lildmh added a comment. Update diff and pass test. Please accept CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67833/new/ https://reviews.llvm.org/D67833 Files: clang/include/clang/AST/OpenMPClause.h

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

2020-07-14 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D67833#2151501 , @lildmh wrote: > I'll update the diff and please check and accept after that Ok CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67833/new/ https://reviews.llvm.org/D67833

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

2020-07-14 Thread Lingda Li via Phabricator via cfe-commits
lildmh requested review of this revision. lildmh added a comment. I'll update the diff and please check and accept after that CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67833/new/ https://reviews.llvm.org/D67833 ___ cfe-commits mailing

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

2019-12-18 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:8981-8982 + // Convert the size in bytes into the number of array elements. + Size = MapperCGF.Builder.CreateExactUDiv( + Size, MapperCGF.Builder.getInt64(ElementSize.getQuantity()));

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

2019-12-18 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:8981-8982 + // Convert the size in bytes into the number of array elements. + Size = MapperCGF.Builder.CreateExactUDiv( + Size,

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

2019-12-18 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:8981-8982 + // Convert the size in bytes into the number of array elements. + Size = MapperCGF.Builder.CreateExactUDiv( + Size, MapperCGF.Builder.getInt64(ElementSize.getQuantity()));

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

2019-12-18 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:8981-8982 + // Convert the size in bytes into the number of array elements. + Size = MapperCGF.Builder.CreateExactUDiv( + Size,

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

2019-12-18 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:8981-8982 + // Convert the size in bytes into the number of array elements. + Size = MapperCGF.Builder.CreateExactUDiv( + Size, MapperCGF.Builder.getInt64(ElementSize.getQuantity()));

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

2019-12-18 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:8981-8982 + // Convert the size in bytes into the number of array elements. + Size = MapperCGF.Builder.CreateExactUDiv( + Size,

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

2019-12-18 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:8981-8982 + // Convert the size in bytes into the number of array elements. + Size = MapperCGF.Builder.CreateExactUDiv( + Size, MapperCGF.Builder.getInt64(ElementSize.getQuantity()));

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

2019-12-18 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 234579. lildmh added a comment. Change the function name CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67833/new/ https://reviews.llvm.org/D67833 Files: clang/include/clang/AST/OpenMPClause.h clang/lib/CodeGen/CGOpenMPRuntime.cpp

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

2019-12-18 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked 2 inline comments as done. lildmh added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:8986 CGM.getTypes().ConvertTypeForMem(C.getPointerType(PtrTy))); llvm::Value *PtrEnd = MapperCGF.Builder.CreateGEP(PtrBegin, Size); llvm::Value

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

2019-12-18 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:8981-8982 + // Convert the size in bytes into the number of array elements. + Size = MapperCGF.Builder.CreateExactUDiv( + Size, MapperCGF.Builder.getInt64(ElementSize.getQuantity()));

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

2019-12-18 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked 2 inline comments as done. lildmh added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:8981-8982 + // Convert the size in bytes into the number of array elements. + Size = MapperCGF.Builder.CreateExactUDiv( + Size,

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

2019-12-18 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:8981-8982 + // Convert the size in bytes into the number of array elements. + Size = MapperCGF.Builder.CreateExactUDiv( + Size, MapperCGF.Builder.getInt64(ElementSize.getQuantity()));

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

2019-12-18 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:9244 +llvm::Function * +CGOpenMPRuntime::getUserDefinedMapperFunc(const OMPDeclareMapperDecl *D) { + auto I = UDMMap.find(D); lildmh wrote: > ABataev wrote: > >

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

2019-12-18 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked 2 inline comments as done. lildmh added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:8981-8982 + // Convert the size in bytes into the number of array elements. + Size = MapperCGF.Builder.CreateExactUDiv( + Size,

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

2019-12-18 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. Looks much better in general, need to resolve last one issue with number of elements/size and you're ready. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:8981-8982 + // Convert the size in bytes into the number of array elements. + Size =

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

2019-12-18 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 234554. lildmh marked 3 inline comments as done. lildmh added a comment. Address Alexey's comments to change mapper function size and refactor code CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67833/new/ https://reviews.llvm.org/D67833 Files:

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

2019-12-17 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked an inline comment as done. lildmh added inline comments. Comment at: clang/include/clang/AST/OpenMPClause.h:4918 const OMPMappableExprListSizeTy ) - : OMPMappableExprListClause(OMPC_map, Locs, Sizes, , -

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

2019-12-17 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/include/clang/AST/OpenMPClause.h:4918 const OMPMappableExprListSizeTy ) - : OMPMappableExprListClause(OMPC_map, Locs, Sizes, , - ), + :

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

2019-12-16 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked 4 inline comments as done. lildmh added inline comments. Comment at: clang/include/clang/AST/OpenMPClause.h:4918 const OMPMappableExprListSizeTy ) - : OMPMappableExprListClause(OMPC_map, Locs, Sizes, , -

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

2019-12-16 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/include/clang/AST/OpenMPClause.h:4918 const OMPMappableExprListSizeTy ) - : OMPMappableExprListClause(OMPC_map, Locs, Sizes, , - ), + :

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

2019-12-16 Thread Lingda Li via Phabricator via cfe-commits
lildmh marked 5 inline comments as done. lildmh added a comment. Alexey, thanks for the review Comment at: clang/include/clang/AST/OpenMPClause.h:4918 const OMPMappableExprListSizeTy ) - : OMPMappableExprListClause(OMPC_map, Locs, Sizes, , -

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

2019-12-16 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/include/clang/AST/OpenMPClause.h:4918 const OMPMappableExprListSizeTy ) - : OMPMappableExprListClause(OMPC_map, Locs, Sizes, , - ), + :

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

2019-12-16 Thread Lingda Li via Phabricator via cfe-commits
lildmh added a comment. I'll split the patch into 2 later Comment at: lib/CodeGen/CGOpenMPRuntime.cpp:7388 - llvm::Value *getExprTypeSize(const Expr *E) const { + llvm::Value *getExprTypeSize(const Expr *E, bool hasMapper) const { QualType ExprTy =

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

2019-12-16 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 234113. lildmh marked 28 inline comments as done. lildmh added a comment. Rebase and address comments CHANGES SINCE LAST ACTION https://reviews.llvm.org/D67833/new/ https://reviews.llvm.org/D67833 Files: clang/include/clang/AST/OpenMPClause.h

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

2019-11-14 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. I would suggest to split this patch into 2 part: the first one is NFC and just makes the ompiler to use the new interfaces and the second with the new functionality for mappers. Comment at: include/clang/AST/OpenMPClause.h:4298 + /// use_device_ptr

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

2019-11-13 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 229200. lildmh added a comment. Rebase 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

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

2019-09-26 Thread Lingda Li via Phabricator via cfe-commits
lildmh updated this revision to Diff 222066. lildmh added a comment. Rebase 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

[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

[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