diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2020-09-15 15:57:11 -0400 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2020-09-15 17:21:38 -0400 |
commit | 9e3842d60351f986d77dfe0a94f76e4fd895f188 (patch) | |
tree | c858cb9a1c22fb8b8199d69be40a7b1106a9be7b /clang/lib/CodeGen/CGOpenMPRuntime.cpp | |
parent | [mlir] Rename 'setInsertionPointAfter' to avoid ambiguity (diff) | |
download | llvm-project-9e3842d60351f986d77dfe0a94f76e4fd895f188.tar.gz llvm-project-9e3842d60351f986d77dfe0a94f76e4fd895f188.tar.bz2 llvm-project-9e3842d60351f986d77dfe0a94f76e4fd895f188.zip |
[OPENMP]Fix codegen for is_device_ptr component, captured by reference.
Need to map the component as TO instead of the literal, because need to
pass a reference to a component if the pointer is overaligned.
Reviewed By: jdoerfert
Differential Revision: https://reviews.llvm.org/D84887
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGOpenMPRuntime.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp index e507e434d9e1..dfd9752c20c9 100644 --- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp +++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp @@ -8460,10 +8460,12 @@ public: if (DevPointersMap.count(VD)) { CombinedInfo.BasePointers.emplace_back(Arg, VD); CombinedInfo.Pointers.push_back(Arg); - CombinedInfo.Sizes.push_back( - CGF.Builder.CreateIntCast(CGF.getTypeSize(CGF.getContext().VoidPtrTy), - CGF.Int64Ty, /*isSigned=*/true)); - CombinedInfo.Types.push_back(OMP_MAP_LITERAL | OMP_MAP_TARGET_PARAM); + CombinedInfo.Sizes.push_back(CGF.Builder.CreateIntCast( + CGF.getTypeSize(CGF.getContext().VoidPtrTy), CGF.Int64Ty, + /*isSigned=*/true)); + CombinedInfo.Types.push_back( + (Cap->capturesVariable() ? OMP_MAP_TO : OMP_MAP_LITERAL) | + OMP_MAP_TARGET_PARAM); CombinedInfo.Mappers.push_back(nullptr); return; } |