aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel E. Denny <jdenny.ornl@gmail.com>2020-07-28 18:06:24 -0400
committerJoel E. Denny <jdenny.ornl@gmail.com>2020-07-28 19:15:18 -0400
commit3c3faae497046be706df29e16c9fbccb7e1fce09 (patch)
tree230a261494cd41163741736cfc68ec89a491fe6a /clang/lib/CodeGen/CGOpenMPRuntime.cpp
parent[OpenMP][NFC] Consolidate `to` and `from` clause modifiers (diff)
downloadllvm-project-3c3faae497046be706df29e16c9fbccb7e1fce09.tar.gz
llvm-project-3c3faae497046be706df29e16c9fbccb7e1fce09.tar.bz2
llvm-project-3c3faae497046be706df29e16c9fbccb7e1fce09.zip
[OpenMP] Implement TR8 `present` motion modifier in Clang (1/2)
This patch implements Clang front end support for the OpenMP TR8 `present` motion modifier for `omp target update` directives. The next patch in this series implements OpenMP runtime support. Reviewed By: ABataev Differential Revision: https://reviews.llvm.org/D84711
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntime.cpp')
-rw-r--r--clang/lib/CodeGen/CGOpenMPRuntime.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntime.cpp b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
index f16f2ed89de8..f7e0d7a56d5a 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntime.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntime.cpp
@@ -7920,6 +7920,20 @@ private:
Layout.push_back(Data.get<const FieldDecl *>());
}
}
+ static void translateMotionModifiers(
+ ArrayRef<OpenMPMotionModifierKind> MotionModifiers,
+ SmallVectorImpl<OpenMPMapModifierKind> &MapModifiers) {
+ for (OpenMPMotionModifierKind MotionMod : MotionModifiers) {
+ switch (MotionMod) {
+ case OMPC_MOTION_MODIFIER_present:
+ MapModifiers.push_back(OMPC_MAP_MODIFIER_present);
+ break;
+ case OMPC_MOTION_MODIFIER_mapper:
+ case OMPC_MOTION_MODIFIER_unknown:
+ break;
+ }
+ }
+ }
public:
MappableExprsHandler(const OMPExecutableDirective &Dir, CodeGenFunction &CGF)
@@ -8038,12 +8052,16 @@ public:
}
for (const auto *C : CurExecDir->getClausesOfKind<OMPToClause>())
for (const auto L : C->component_lists()) {
- InfoGen(std::get<0>(L), std::get<1>(L), OMPC_MAP_to, llvm::None,
+ SmallVector<OpenMPMapModifierKind, 2> MapModifiers;
+ translateMotionModifiers(C->getMotionModifiers(), MapModifiers);
+ InfoGen(std::get<0>(L), std::get<1>(L), OMPC_MAP_to, MapModifiers,
/*ReturnDevicePointer=*/false, C->isImplicit(), std::get<2>(L));
}
for (const auto *C : CurExecDir->getClausesOfKind<OMPFromClause>())
for (const auto L : C->component_lists()) {
- InfoGen(std::get<0>(L), std::get<1>(L), OMPC_MAP_from, llvm::None,
+ SmallVector<OpenMPMapModifierKind, 2> MapModifiers;
+ translateMotionModifiers(C->getMotionModifiers(), MapModifiers);
+ InfoGen(std::get<0>(L), std::get<1>(L), OMPC_MAP_from, MapModifiers,
/*ReturnDevicePointer=*/false, C->isImplicit(), std::get<2>(L));
}