]> granicus.if.org Git - clang/commit
[OPENMP] Codegen for 'firstprivate' clause.
authorAlexey Bataev <a.bataev@hotmail.com>
Wed, 8 Oct 2014 10:42:55 +0000 (10:42 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Wed, 8 Oct 2014 10:42:55 +0000 (10:42 +0000)
commit10b0957de4fe18602a2c45f3bb8afa1c4fae65be
treeed7c2ad862766159ff6ca65410d895833975fc5b
parent37d95eb570d368aee65a2886788ac8ab9dd1b8ee
[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@219295 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