[PATCH] D145093: Add map info for dereference pointer.

2023-03-07 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:7489-7493 + if (UO && UO->getOpcode() == UO_Deref) +if (isa(Last->getAssociatedExpression()) || +isa(Last->getAssociatedExpression()) || +isa(Last->getAssociatedE

[PATCH] D145093: Add map info for dereference pointer.

2023-03-07 Thread Jennifer Yu via Phabricator via cfe-commits
jyu2 added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:7489-7493 + if (UO && UO->getOpcode() == UO_Deref) +if (isa(Last->getAssociatedExpression()) || +isa(Last->getAssociatedExpression()) || +isa(Last->getAssociatedExpr

[PATCH] D145093: Add map info for dereference pointer.

2023-03-07 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:7489-7493 + if (UO && UO->getOpcode() == UO_Deref) +if (isa(Last->getAssociatedExpression()) || +isa(Last->getAssociatedExpression()) || +isa(Last->getAssociatedE

[PATCH] D145093: Add map info for dereference pointer.

2023-03-06 Thread Jennifer Yu via Phabricator via cfe-commits
jyu2 added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:7489-7493 + if (UO && UO->getOpcode() == UO_Deref) +if (isa(Last->getAssociatedExpression()) || +isa(Last->getAssociatedExpression()) || +isa(Last->getAssociatedExpr

[PATCH] D145093: Add map info for dereference pointer.

2023-03-06 Thread Jennifer Yu via Phabricator via cfe-commits
jyu2 updated this revision to Diff 502842. jyu2 added a comment. Add additional test as Alexey asked. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145093/new/ https://reviews.llvm.org/D145093 Files: clang/lib/CodeGen/CGOpenMPRuntime.cpp clang

[PATCH] D145093: Add map info for dereference pointer.

2023-03-03 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:7489-7493 + if (UO && UO->getOpcode() == UO_Deref) +if (isa(Last->getAssociatedExpression()) || +isa(Last->getAssociatedExpression()) || +isa(Last->getAssociatedE

[PATCH] D145093: Add map info for dereference pointer.

2023-03-03 Thread Jennifer Yu via Phabricator via cfe-commits
jyu2 marked an inline comment as done. jyu2 added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:7489-7493 + if (UO && UO->getOpcode() == UO_Deref) +if (isa(Last->getAssociatedExpression()) || +isa(Last->getAssociatedExpression()) || +

[PATCH] D145093: Add map info for dereference pointer.

2023-03-03 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:7489-7493 + if (UO && UO->getOpcode() == UO_Deref) +if (isa(Last->getAssociatedExpression()) || +isa(Last->getAssociatedExpression()) || +isa(Last->getAssociatedE

[PATCH] D145093: Add map info for dereference pointer.

2023-03-03 Thread Jennifer Yu via Phabricator via cfe-commits
jyu2 marked an inline comment as done. jyu2 added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:7487-7497 + auto TNext = Next; + bool IsVarDerefAssoWithArray = false; + if (UO && UO->getOpcode() == UO_Deref) +for (; TNext != CE; TNext =

[PATCH] D145093: Add map info for dereference pointer.

2023-03-03 Thread Jennifer Yu via Phabricator via cfe-commits
jyu2 updated this revision to Diff 502144. jyu2 added a comment. Thanks Alexey for the code review. I removed loop by using last expression in the component for checking. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145093/new/ https://reviews.l

[PATCH] D145093: Add map info for dereference pointer.

2023-03-02 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:7487-7497 + auto TNext = Next; + bool IsVarDerefAssoWithArray = false; + if (UO && UO->getOpcode() == UO_Deref) +for (; TNext != CE; TNext = std::next(TNext)) + if (is

[PATCH] D145093: Add map info for dereference pointer.

2023-03-02 Thread Jennifer Yu via Phabricator via cfe-commits
jyu2 added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:7487-7497 + auto TNext = Next; + bool IsVarDerefAssoWithArray = false; + if (UO && UO->getOpcode() == UO_Deref) +for (; TNext != CE; TNext = std::next(TNext)) + if (isa(T

[PATCH] D145093: Add map info for dereference pointer.

2023-03-02 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:7487-7497 + auto TNext = Next; + bool IsVarDerefAssoWithArray = false; + if (UO && UO->getOpcode() == UO_Deref) +for (; TNext != CE; TNext = std::next(TNext)) + if (is

[PATCH] D145093: Add map info for dereference pointer.

2023-03-02 Thread Jennifer Yu via Phabricator via cfe-commits
jyu2 added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:7487-7497 + auto TNext = Next; + bool IsVarDerefAssoWithArray = false; + if (UO && UO->getOpcode() == UO_Deref) +for (; TNext != CE; TNext = std::next(TNext)) + if (isa(T

[PATCH] D145093: Add map info for dereference pointer.

2023-03-02 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/lib/CodeGen/CGOpenMPRuntime.cpp:7487-7497 + auto TNext = Next; + bool IsVarDerefAssoWithArray = false; + if (UO && UO->getOpcode() == UO_Deref) +for (; TNext != CE; TNext = std::next(TNext)) + if (is

[PATCH] D145093: Add map info for dereference pointer.

2023-03-02 Thread Jennifer Yu via Phabricator via cfe-commits
jyu2 added a comment. > Yes, I understand. And did not ask for it. I just mean that a[0][:3] emits > different mapping data - TARGET_PAPARM|TO|FROM, PTR_AND_OBJ|TO|FROM Oh I see. I was think alloc for adding pointer. But I now think I should just orignal maptype. Changed thanks. Repository

[PATCH] D145093: Add map info for dereference pointer.

2023-03-02 Thread Jennifer Yu via Phabricator via cfe-commits
jyu2 updated this revision to Diff 501921. jyu2 added a comment. Thanks Alexey for the review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145093/new/ https://reviews.llvm.org/D145093 Files: clang/lib/CodeGen/CGOpenMPRuntime.cpp clang/lib/Se

[PATCH] D145093: Add map info for dereference pointer.

2023-03-02 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D145093#4164877 , @jyu2 wrote: >> I mean we shall emit the same mapping for `(*a)[:3]` and for `a[0][:3]` > > Yes I mean emit (*a)[:3] as a[0][:3] > > The difficulty is during the process array section of > OMPArraySectionExpr

[PATCH] D145093: Add map info for dereference pointer.

2023-03-02 Thread Jennifer Yu via Phabricator via cfe-commits
jyu2 added a comment. > I mean we shall emit the same mapping for `(*a)[:3]` and for `a[0][:3]` Yes I mean emit (*a)[:3] as a[0][:3] The difficulty is during the process array section of OMPArraySectionExpr 0x12aa37e0 '' lvalue | -ImplicitCastExpr 0x12a8a918 'int *' | | `-ArraySubscriptExpr 0

[PATCH] D145093: Add map info for dereference pointer.

2023-03-02 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. In D145093#4164854 , @jyu2 wrote: > In D145093#4164528 , @ABataev wrote: > >> What result produces `map(a[0][:3]`? > > Yes, that would be another way to fix the runtime problem. However t

[PATCH] D145093: Add map info for dereference pointer.

2023-03-02 Thread Jennifer Yu via Phabricator via cfe-commits
jyu2 added a comment. In D145093#4164528 , @ABataev wrote: > What result produces `map(a[0][:3]`? Yes, that would be another way to fix the runtime problem. However the difficulty is when process array section, section base is different. with a[0][:3]

[PATCH] D145093: Add map info for dereference pointer.

2023-03-02 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added a comment. What result produces `map(a[0][:3]`? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D145093/new/ https://reviews.llvm.org/D145093 ___ cfe-commits mailing list cfe-commits@lists.llv

[PATCH] D145093: Add map info for dereference pointer.

2023-03-01 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/test/OpenMP/target_map_deref_array_codegen.cpp:17 +(*t1d)[j] = 1; + #pragma omp target map(to: (*t1d)[0:3]) +(*t1d)[2] = 2; jyu2 wrote: > ABataev wrote: > > Is this correct at all? This is not a pointer to

[PATCH] D145093: Add map info for dereference pointer.

2023-03-01 Thread Jennifer Yu via Phabricator via cfe-commits
jyu2 added inline comments. Comment at: clang/test/OpenMP/target_map_deref_array_codegen.cpp:17 +(*t1d)[j] = 1; + #pragma omp target map(to: (*t1d)[0:3]) +(*t1d)[2] = 2; ABataev wrote: > Is this correct at all? This is not a pointer to the array, it is a

[PATCH] D145093: Add map info for dereference pointer.

2023-03-01 Thread Alexey Bataev via Phabricator via cfe-commits
ABataev added inline comments. Comment at: clang/test/OpenMP/target_map_deref_array_codegen.cpp:17 +(*t1d)[j] = 1; + #pragma omp target map(to: (*t1d)[0:3]) +(*t1d)[2] = 2; Is this correct at all? This is not a pointer to the array, it is an array of po

[PATCH] D145093: Add map info for dereference pointer.

2023-03-01 Thread Jennifer Yu via Phabricator via cfe-commits
jyu2 created this revision. jyu2 added reviewers: ABataev, mikerice, jdoerfert. jyu2 added a project: OpenMP. Herald added a project: All. jyu2 requested review of this revision. Herald added subscribers: openmp-commits, cfe-commits, sstefan1. Herald added a project: clang. This is to fix run time