]> granicus.if.org Git - clang/commit
[OPENMP] Codegen for 'firstprivate' clause.
authorAlexey Bataev <a.bataev@hotmail.com>
Wed, 8 Oct 2014 11:35:04 +0000 (11:35 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Wed, 8 Oct 2014 11:35:04 +0000 (11:35 +0000)
commit91cc6cf853648f7999d10e6336bd750b732b2d88
tree4d09b7c8ab4382e2135a71389de4b31607aac89a
parenta08c9151a7104312a5cc51f151e023e56219bb5b
[OPENMP] Codegen for 'firstprivate' clause.
This patch generates some helper variables that used as private copies of the corresponding original variables inside an OpenMP 'parallel' directive. These generated variables are initialized by copy using values of the original variables (with the copy constructor, if any). For arrays, initializator is generated for single element and in the codegen procedure this initial value is automatically propagated between all elements of the private copy.
In outlined function, references to original variables are replaced by the references to these private helper variables. At the end of the initialization of the private variables an implicit barier is generated by calling __kmpc_barrier(...) runtime function to be sure that all threads were initialized using original values of the variables.
Differential Revision: http://reviews.llvm.org/D5140

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@219297 91177308-0d34-0410-b5e6-96231b3b80d8
26 files changed:
include/clang/AST/DataRecursiveASTVisitor.h
include/clang/AST/OpenMPClause.h
include/clang/AST/RecursiveASTVisitor.h
include/clang/Basic/DiagnosticSemaKinds.td
lib/AST/Stmt.cpp
lib/AST/StmtProfile.cpp
lib/CodeGen/CGDecl.cpp
lib/CodeGen/CGOpenMPRuntime.cpp
lib/CodeGen/CGOpenMPRuntime.h
lib/CodeGen/CGStmtOpenMP.cpp
lib/CodeGen/CodeGenFunction.h
lib/Sema/SemaOpenMP.cpp
lib/Serialization/ASTReaderStmt.cpp
lib/Serialization/ASTWriterStmt.cpp
test/OpenMP/for_firstprivate_messages.cpp
test/OpenMP/for_simd_firstprivate_messages.cpp
test/OpenMP/parallel_codegen.cpp
test/OpenMP/parallel_firstprivate_codegen.cpp [new file with mode: 0644]
test/OpenMP/parallel_firstprivate_messages.cpp
test/OpenMP/parallel_for_firstprivate_messages.cpp
test/OpenMP/parallel_for_simd_firstprivate_messages.cpp
test/OpenMP/parallel_sections_firstprivate_messages.cpp
test/OpenMP/sections_firstprivate_messages.cpp
test/OpenMP/single_firstprivate_messages.cpp
test/OpenMP/task_firstprivate_messages.cpp
test/OpenMP/task_messages.cpp