]> granicus.if.org Git - clang/commit
[OPENMP] Codegen for 'firstprivate' clause.
authorAlexey Bataev <a.bataev@hotmail.com>
Wed, 8 Oct 2014 14:01:46 +0000 (14:01 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Wed, 8 Oct 2014 14:01:46 +0000 (14:01 +0000)
commit1cda60139ae87295769685ac14efac216207308c
treee80973f47052f6c52c86c5ee8008933d3f9b2217
parenteee131df0806f9e9545fcc499d25864b7c0c3391
[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@219306 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