summaryrefslogtreecommitdiffstats
path: root/clang
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2017-11-22 17:19:31 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2017-11-22 17:19:31 +0000
commit7f96c375acaab34d2b314840431b07f13e3b68d0 (patch)
tree13dec1f72d1568e7198e89fb4eea6249d1a43737 /clang
parent221e7bb1fc5643cfb9225fc3be395fe3b7e82177 (diff)
downloadbcm5719-llvm-7f96c375acaab34d2b314840431b07f13e3b68d0.tar.gz
bcm5719-llvm-7f96c375acaab34d2b314840431b07f13e3b68d0.zip
[OPENMP] General improvement of code, NFC.
llvm-svn: 318849
Diffstat (limited to 'clang')
-rw-r--r--clang/lib/Basic/OpenMPKinds.cpp22
-rw-r--r--clang/lib/Sema/SemaOpenMP.cpp19
2 files changed, 27 insertions, 14 deletions
diff --git a/clang/lib/Basic/OpenMPKinds.cpp b/clang/lib/Basic/OpenMPKinds.cpp
index 6cea8f4597c..b318f7e034a 100644
--- a/clang/lib/Basic/OpenMPKinds.cpp
+++ b/clang/lib/Basic/OpenMPKinds.cpp
@@ -901,6 +901,17 @@ void clang::getOpenMPCaptureRegions(
CaptureRegions.push_back(OMPD_teams);
CaptureRegions.push_back(OMPD_parallel);
break;
+ case OMPD_target_parallel:
+ case OMPD_target_parallel_for:
+ case OMPD_target_parallel_for_simd:
+ CaptureRegions.push_back(OMPD_target);
+ CaptureRegions.push_back(OMPD_parallel);
+ break;
+ case OMPD_target_enter_data:
+ case OMPD_target_exit_data:
+ case OMPD_target_update:
+ CaptureRegions.push_back(OMPD_task);
+ break;
case OMPD_teams:
case OMPD_simd:
case OMPD_for:
@@ -929,17 +940,6 @@ void clang::getOpenMPCaptureRegions(
case OMPD_target_teams_distribute_simd:
CaptureRegions.push_back(DKind);
break;
- case OMPD_target_parallel:
- case OMPD_target_parallel_for:
- case OMPD_target_parallel_for_simd:
- CaptureRegions.push_back(OMPD_target);
- CaptureRegions.push_back(OMPD_parallel);
- break;
- case OMPD_target_enter_data:
- case OMPD_target_exit_data:
- case OMPD_target_update:
- CaptureRegions.push_back(OMPD_task);
- break;
case OMPD_threadprivate:
case OMPD_taskyield:
case OMPD_barrier:
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp
index 6c56d0c185a..290221a0de4 100644
--- a/clang/lib/Sema/SemaOpenMP.cpp
+++ b/clang/lib/Sema/SemaOpenMP.cpp
@@ -6777,13 +6777,24 @@ StmtResult Sema::ActOnOpenMPDistributeParallelForDirective(
// The point of exit cannot be a branch out of the structured block.
// longjmp() and throw() must not violate the entry/exit criteria.
CS->getCapturedDecl()->setNothrow();
+ for (int ThisCaptureLevel =
+ getOpenMPCaptureLevels(OMPD_distribute_parallel_for);
+ ThisCaptureLevel > 1; --ThisCaptureLevel) {
+ CS = cast<CapturedStmt>(CS->getCapturedStmt());
+ // 1.2.2 OpenMP Language Terminology
+ // Structured block - An executable statement with a single entry at the
+ // top and a single exit at the bottom.
+ // The point of exit cannot be a branch out of the structured block.
+ // longjmp() and throw() must not violate the entry/exit criteria.
+ CS->getCapturedDecl()->setNothrow();
+ }
OMPLoopDirective::HelperExprs B;
// In presence of clause 'collapse' with number of loops, it will
// define the nested loops number.
unsigned NestedLoopCount = CheckOpenMPLoop(
OMPD_distribute_parallel_for, getCollapseNumberExpr(Clauses),
- nullptr /*ordered not a clause on distribute*/, AStmt, *this, *DSAStack,
+ nullptr /*ordered not a clause on distribute*/, CS, *this, *DSAStack,
VarsWithImplicitDSA, B);
if (NestedLoopCount == 0)
return StmtError();
@@ -7723,14 +7734,16 @@ static OpenMPDirectiveKind getOpenMPCaptureRegionForClause(
case OMPD_teams_distribute_parallel_for:
CaptureRegion = OMPD_teams;
break;
+ case OMPD_distribute_parallel_for:
+ CaptureRegion = OMPD_parallel;
+ break;
case OMPD_parallel_for:
case OMPD_parallel_for_simd:
case OMPD_target_teams_distribute_parallel_for:
case OMPD_target_teams_distribute_parallel_for_simd:
case OMPD_teams_distribute_parallel_for_simd:
- case OMPD_distribute_parallel_for:
case OMPD_distribute_parallel_for_simd:
- // Do not capture thread_limit-clause expressions.
+ // Do not capture schedule clause expressions.
break;
case OMPD_task:
case OMPD_taskloop:
OpenPOWER on IntegriCloud