diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-12-18 10:24:53 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-12-18 10:24:53 +0000 |
commit | 6f531ec0a2510d07fe592e2a7698733bbb45f519 (patch) | |
tree | c1630c4f50f43fe62d55449d9781b27338428b22 /clang/lib/CodeGen/CGStmtOpenMP.cpp | |
parent | 252cca555f3c9b0958573092873f239430dd47fe (diff) | |
download | bcm5719-llvm-6f531ec0a2510d07fe592e2a7698733bbb45f519.tar.gz bcm5719-llvm-6f531ec0a2510d07fe592e2a7698733bbb45f519.zip |
[OPENMP] Remove explicit call for implicit barrier
#pragma omp parallel needs an implicit barrier that is currently done by an explicit call to __kmpc_barrier. However, the runtime already ensures a barrier in __kmpc_fork_call which currently leads to two barriers per region per thread.
Differential Revision: http://reviews.llvm.org/D15561
llvm-svn: 255992
Diffstat (limited to 'clang/lib/CodeGen/CGStmtOpenMP.cpp')
-rw-r--r-- | clang/lib/CodeGen/CGStmtOpenMP.cpp | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp index e5f12ebdee8..bcd2ac51929 100644 --- a/clang/lib/CodeGen/CGStmtOpenMP.cpp +++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp @@ -893,10 +893,6 @@ void CodeGenFunction::EmitOMPParallelDirective(const OMPParallelDirective &S) { (void)PrivateScope.Privatize(); CGF.EmitStmt(cast<CapturedStmt>(S.getAssociatedStmt())->getCapturedStmt()); CGF.EmitOMPReductionClauseFinal(S); - // Emit implicit barrier at the end of the 'parallel' directive. - CGF.CGM.getOpenMPRuntime().emitBarrierCall( - CGF, S.getLocStart(), OMPD_unknown, /*EmitChecks=*/false, - /*ForceSimpleCall=*/true); }; emitCommonOMPParallelDirective(*this, S, OMPD_parallel, CodeGen); } @@ -1873,12 +1869,6 @@ void CodeGenFunction::EmitOMPParallelForDirective( (void)emitScheduleClause(*this, S, /*OuterRegion=*/true); auto &&CodeGen = [&S](CodeGenFunction &CGF) { CGF.EmitOMPWorksharingLoop(S); - // Emit implicit barrier at the end of parallel region, but this barrier - // is at the end of 'for' directive, so emit it as the implicit barrier for - // this 'for' directive. - CGF.CGM.getOpenMPRuntime().emitBarrierCall( - CGF, S.getLocStart(), OMPD_parallel, /*EmitChecks=*/false, - /*ForceSimpleCall=*/true); }; emitCommonOMPParallelDirective(*this, S, OMPD_for, CodeGen); } @@ -1891,12 +1881,6 @@ void CodeGenFunction::EmitOMPParallelForSimdDirective( (void)emitScheduleClause(*this, S, /*OuterRegion=*/true); auto &&CodeGen = [&S](CodeGenFunction &CGF) { CGF.EmitOMPWorksharingLoop(S); - // Emit implicit barrier at the end of parallel region, but this barrier - // is at the end of 'for' directive, so emit it as the implicit barrier for - // this 'for' directive. - CGF.CGM.getOpenMPRuntime().emitBarrierCall( - CGF, S.getLocStart(), OMPD_parallel, /*EmitChecks=*/false, - /*ForceSimpleCall=*/true); }; emitCommonOMPParallelDirective(*this, S, OMPD_simd, CodeGen); } @@ -1908,10 +1892,6 @@ void CodeGenFunction::EmitOMPParallelSectionsDirective( LexicalScope Scope(*this, S.getSourceRange()); auto &&CodeGen = [&S](CodeGenFunction &CGF) { (void)CGF.EmitSections(S); - // Emit implicit barrier at the end of parallel region. - CGF.CGM.getOpenMPRuntime().emitBarrierCall( - CGF, S.getLocStart(), OMPD_parallel, /*EmitChecks=*/false, - /*ForceSimpleCall=*/true); }; emitCommonOMPParallelDirective(*this, S, OMPD_sections, CodeGen); } |