diff options
author | Reid Kleckner <rnk@google.com> | 2019-12-04 14:50:06 -0800 |
---|---|---|
committer | Reid Kleckner <rnk@google.com> | 2019-12-04 14:50:06 -0800 |
commit | 33f6d465d790ac5c9b949e6bc05127d356212079 (patch) | |
tree | 99508efd07e3db1d9d326e7e0f7af23aaf1ed0c0 /clang/lib/CodeGen/CGStmtOpenMP.cpp | |
parent | 9c29aed6980dce42f2a071db09663c435ac21ad1 (diff) | |
download | bcm5719-llvm-33f6d465d790ac5c9b949e6bc05127d356212079.tar.gz bcm5719-llvm-33f6d465d790ac5c9b949e6bc05127d356212079.zip |
Revert "[OpenMP50] Add parallel master construct, by Chi Chun Chen."
This reverts commit 713dab21e27c987b9114547ce7136bac2e775de9.
Tests do not pass on Windows.
Diffstat (limited to 'clang/lib/CodeGen/CGStmtOpenMP.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGStmtOpenMP.cpp | 37 |
1 files changed, 2 insertions, 35 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index a5190007406..1e6933df708 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -2897,17 +2897,13 @@ void CodeGenFunction::EmitOMPSingleDirective(const OMPSingleDirective &S) { } } -static void emitMaster(CodeGenFunction &CGF, const OMPExecutableDirective &S) { +void CodeGenFunction::EmitOMPMasterDirective(const OMPMasterDirective &S) { auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) { Action.Enter(CGF); CGF.EmitStmt(S.getInnermostCapturedStmt()->getCapturedStmt()); }; - CGF.CGM.getOpenMPRuntime().emitMasterRegion(CGF, CodeGen, S.getBeginLoc()); -} - -void CodeGenFunction::EmitOMPMasterDirective(const OMPMasterDirective &S) { OMPLexicalScope Scope(*this, S, OMPD_unknown); - emitMaster(*this, S); + CGM.getOpenMPRuntime().emitMasterRegion(*this, CodeGen, S.getBeginLoc()); } void CodeGenFunction::EmitOMPCriticalDirective(const OMPCriticalDirective &S) { @@ -2951,35 +2947,6 @@ void CodeGenFunction::EmitOMPParallelForSimdDirective( emitEmptyBoundParameters); } -void CodeGenFunction::EmitOMPParallelMasterDirective( - const OMPParallelMasterDirective &S) { - // Emit directive as a combined directive that consists of two implicit - // directives: 'parallel' with 'master' directive. - auto &&CodeGen = [&S](CodeGenFunction &CGF, PrePostActionTy &Action) { - Action.Enter(CGF); - OMPPrivateScope PrivateScope(CGF); - bool Copyins = CGF.EmitOMPCopyinClause(S); - (void)CGF.EmitOMPFirstprivateClause(S, PrivateScope); - if (Copyins) { - // Emit implicit barrier to synchronize threads and avoid data races on - // propagation master's thread values of threadprivate variables to local - // instances of that variables of all other implicit threads. - CGF.CGM.getOpenMPRuntime().emitBarrierCall( - CGF, S.getBeginLoc(), OMPD_unknown, /*EmitChecks=*/false, - /*ForceSimpleCall=*/true); - } - CGF.EmitOMPPrivateClause(S, PrivateScope); - CGF.EmitOMPReductionClauseInit(S, PrivateScope); - (void)PrivateScope.Privatize(); - emitMaster(CGF, S); - CGF.EmitOMPReductionClauseFinal(S, /*ReductionKind=*/OMPD_parallel); - }; - emitCommonOMPParallelDirective(*this, S, OMPD_master, CodeGen, - emitEmptyBoundParameters); - emitPostUpdateForReductionClause(*this, S, - [](CodeGenFunction &) { return nullptr; }); -} - void CodeGenFunction::EmitOMPParallelSectionsDirective( const OMPParallelSectionsDirective &S) { // Emit directive as a combined directive that consists of two implicit |