summaryrefslogtreecommitdiffstats
path: root/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2018-05-11 19:45:14 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2018-05-11 19:45:14 +0000
commitdf093e7b45b345493b545b5639c5b606689764e7 (patch)
tree300c5b76c60764756bce6265647ddd4832bef387 /clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
parent304d0d55607170da023423c36e34e5bf1f83fa70 (diff)
downloadbcm5719-llvm-df093e7b45b345493b545b5639c5b606689764e7.tar.gz
bcm5719-llvm-df093e7b45b345493b545b5639c5b606689764e7.zip
[OPENMP, NVPTX] Do not use SPMD mode for target simd and target teams
distribute simd directives. Directives `target simd` and `target teams distribute simd` must be executed in non-SPMD mode. llvm-svn: 332129
Diffstat (limited to 'clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp')
-rw-r--r--clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp32
1 files changed, 13 insertions, 19 deletions
diff --git a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
index 98d8b0ff607..bad4a8b3778 100644
--- a/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
+++ b/clang/lib/CodeGen/CGOpenMPRuntimeNVPTX.cpp
@@ -628,9 +628,8 @@ static bool hasNestedSPMDDirective(ASTContext &Ctx,
OpenMPDirectiveKind DKind = NestedDir->getDirectiveKind();
switch (D.getDirectiveKind()) {
case OMPD_target:
- if ((isOpenMPParallelDirective(DKind) &&
- !hasParallelIfClause(Ctx, *NestedDir)) ||
- isOpenMPSimdDirective(DKind))
+ if (isOpenMPParallelDirective(DKind) &&
+ !hasParallelIfClause(Ctx, *NestedDir))
return true;
if (DKind == OMPD_teams || DKind == OMPD_teams_distribute) {
Body = NestedDir->getInnermostCapturedStmt()->IgnoreContainers();
@@ -639,9 +638,8 @@ static bool hasNestedSPMDDirective(ASTContext &Ctx,
ChildStmt = getSingleCompoundChild(Body);
if (const auto *NND = dyn_cast<OMPExecutableDirective>(ChildStmt)) {
DKind = NND->getDirectiveKind();
- if ((isOpenMPParallelDirective(DKind) &&
- !hasParallelIfClause(Ctx, *NND)) ||
- isOpenMPSimdDirective(DKind))
+ if (isOpenMPParallelDirective(DKind) &&
+ !hasParallelIfClause(Ctx, *NND))
return true;
if (DKind == OMPD_distribute) {
Body = NestedDir->getInnermostCapturedStmt()->IgnoreContainers();
@@ -652,18 +650,16 @@ static bool hasNestedSPMDDirective(ASTContext &Ctx,
return false;
if (const auto *NND = dyn_cast<OMPExecutableDirective>(ChildStmt)) {
DKind = NND->getDirectiveKind();
- return (isOpenMPParallelDirective(DKind) &&
- !hasParallelIfClause(Ctx, *NND)) ||
- isOpenMPSimdDirective(DKind);
+ return isOpenMPParallelDirective(DKind) &&
+ !hasParallelIfClause(Ctx, *NND);
}
}
}
}
return false;
case OMPD_target_teams:
- if ((isOpenMPParallelDirective(DKind) &&
- !hasParallelIfClause(Ctx, *NestedDir)) ||
- isOpenMPSimdDirective(DKind))
+ if (isOpenMPParallelDirective(DKind) &&
+ !hasParallelIfClause(Ctx, *NestedDir))
return true;
if (DKind == OMPD_distribute) {
Body = NestedDir->getInnermostCapturedStmt()->IgnoreContainers();
@@ -672,16 +668,14 @@ static bool hasNestedSPMDDirective(ASTContext &Ctx,
ChildStmt = getSingleCompoundChild(Body);
if (const auto *NND = dyn_cast<OMPExecutableDirective>(ChildStmt)) {
DKind = NND->getDirectiveKind();
- return (isOpenMPParallelDirective(DKind) &&
- !hasParallelIfClause(Ctx, *NND)) ||
- isOpenMPSimdDirective(DKind);
+ return isOpenMPParallelDirective(DKind) &&
+ !hasParallelIfClause(Ctx, *NND);
}
}
return false;
case OMPD_target_teams_distribute:
- return (isOpenMPParallelDirective(DKind) &&
- !hasParallelIfClause(Ctx, *NestedDir)) ||
- isOpenMPSimdDirective(DKind);
+ return isOpenMPParallelDirective(DKind) &&
+ !hasParallelIfClause(Ctx, *NestedDir);
case OMPD_target_simd:
case OMPD_target_parallel:
case OMPD_target_parallel_for:
@@ -755,7 +749,7 @@ static bool supportsSPMDExecutionMode(ASTContext &Ctx,
return !hasParallelIfClause(Ctx, D);
case OMPD_target_simd:
case OMPD_target_teams_distribute_simd:
- return true;
+ return false;
case OMPD_parallel:
case OMPD_for:
case OMPD_parallel_for:
OpenPOWER on IntegriCloud