summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
authorAlexey Bataev <a.bataev@hotmail.com>2015-04-24 04:00:39 +0000
committerAlexey Bataev <a.bataev@hotmail.com>2015-04-24 04:00:39 +0000
commit8b72566eec2f35d683655a2cc6e4a4054f85a596 (patch)
treea3fc1b9c5e1874bfcc5d88fcfa3898e6e467af77 /clang/lib
parent2cb9b95adf7a46ccb86ead94e4a6002a4fd7aed5 (diff)
downloadbcm5719-llvm-8b72566eec2f35d683655a2cc6e4a4054f85a596.tar.gz
bcm5719-llvm-8b72566eec2f35d683655a2cc6e4a4054f85a596.zip
[OPENMP] Do not emit implicit barrier for single directive with 'copyprivate' clause(s).
Runtime function for 'copyprivate' directive generates implicit barriers, so no need to emit it. Differential Revision: http://reviews.llvm.org/D9215 llvm-svn: 235692
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/CodeGen/CGStmtOpenMP.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGStmtOpenMP.cpp b/clang/lib/CodeGen/CGStmtOpenMP.cpp
index b88452944c7..bb71604ead7 100644
--- a/clang/lib/CodeGen/CGStmtOpenMP.cpp
+++ b/clang/lib/CodeGen/CGStmtOpenMP.cpp
@@ -1273,8 +1273,9 @@ void CodeGenFunction::EmitOMPSingleDirective(const OMPSingleDirective &S) {
CGM.getOpenMPRuntime().emitSingleRegion(*this, CodeGen, S.getLocStart(),
CopyprivateVars, DestExprs, SrcExprs,
AssignmentOps);
- // Emit an implicit barrier at the end.
- if (!S.getSingleClause(OMPC_nowait)) {
+ // Emit an implicit barrier at the end (if no 'nowait' clause and no
+ // 'copyprivate' clause).
+ if (!S.getSingleClause(OMPC_nowait) && CopyprivateVars.empty()) {
CGM.getOpenMPRuntime().emitBarrierCall(*this, S.getLocStart(), OMPD_single);
}
}
OpenPOWER on IntegriCloud