diff options
| author | Alexey Bataev <a.bataev@hotmail.com> | 2017-11-27 19:38:52 +0000 |
|---|---|---|
| committer | Alexey Bataev <a.bataev@hotmail.com> | 2017-11-27 19:38:52 +0000 |
| commit | 974acd6b13a319d61f88cf3af81bb237c57ebeef (patch) | |
| tree | c8a7082a91680c3f8169685c048a6f1d6b5fda15 /clang/lib/Sema | |
| parent | 87ff0a74677379e95e40f070c2125e877d5c10de (diff) | |
| download | bcm5719-llvm-974acd6b13a319d61f88cf3af81bb237c57ebeef.tar.gz bcm5719-llvm-974acd6b13a319d61f88cf3af81bb237c57ebeef.zip | |
[OPENMP] Codegen for `distribute parallel for simd` directive.
Added proper codegen for `distribute parallel for simd` directive.
llvm-svn: 319078
Diffstat (limited to 'clang/lib/Sema')
| -rw-r--r-- | clang/lib/Sema/SemaOpenMP.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaOpenMP.cpp b/clang/lib/Sema/SemaOpenMP.cpp index 985cc62df09..bd70ca29ce4 100644 --- a/clang/lib/Sema/SemaOpenMP.cpp +++ b/clang/lib/Sema/SemaOpenMP.cpp @@ -6838,13 +6838,24 @@ StmtResult Sema::ActOnOpenMPDistributeParallelForSimdDirective( // 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_simd); + 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_simd, 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(); @@ -7793,6 +7804,7 @@ static OpenMPDirectiveKind getOpenMPCaptureRegionForClause( CaptureRegion = OMPD_teams; break; case OMPD_distribute_parallel_for: + case OMPD_distribute_parallel_for_simd: CaptureRegion = OMPD_parallel; break; case OMPD_parallel_for: @@ -7800,7 +7812,6 @@ static OpenMPDirectiveKind getOpenMPCaptureRegionForClause( 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_simd: // Do not capture schedule clause expressions. break; case OMPD_task: |

