[all-commits] [llvm/llvm-project] 0f2f37: Add map info for dereference pointer.
jyu2-git via All-commits
all-commits at lists.llvm.org
Wed Mar 8 17:59:08 PST 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 0f2f378425821de77e50a0dcb67c4504389a56e8
https://github.com/llvm/llvm-project/commit/0f2f378425821de77e50a0dcb67c4504389a56e8
Author: Jennifer Yu <jennifer.yu at intel.com>
Date: 2023-03-08 (Wed, 08 Mar 2023)
Changed paths:
M clang/lib/CodeGen/CGOpenMPRuntime.cpp
M clang/lib/Sema/SemaOpenMP.cpp
A clang/test/OpenMP/target_map_deref_array_codegen.cpp
M clang/test/OpenMP/target_update_codegen.cpp
A openmp/libomptarget/test/mapping/target_derefence_array_pointrs.cpp
Log Message:
-----------
Add map info for dereference pointer.
This is to fix run time problem when use:
int **a;
map((*a)[:3]), (*a)[1] or map(**a).
current we skip generate map info for dereference pointer:
&(*a), &(*a)[0], 3*sizeof(int), TARGET_PARAM | TO | FROM
One way to fix runtime problem is to generate map info for dereference
pointer.
map((*a)[:3]):
&(*a), &(*a), sizeof(pointer), TARGET_PARAM | TO | FROM
&(*a), &(*a)[0], 3*sizeof(int), PTR_AND_OBJ | TO | FROM
map(**a):
&(*a), &(*a), sizeof(pointer), TARGET_PARAM | TO | FROM
&(*a), &(**a), sizeof(int), PTR_AND_OBJ | TO | FROM
The change in CGOpenMPRuntime.cpp add that.
The change in SemaOpenMP is to fix variable of dereference pointer to array
captured by reference. That is wrong. That cause run time to fail.
The rule is:
If variable is identified in a map clause it is always captured by
reference except if it is a pointer that is dereferenced somehow.
Differential Revision: https://reviews.llvm.org/D145093
More information about the All-commits
mailing list