[OPENMP] Codegen for 'firstprivate' clause in 'sections' directive.
authorAlexey Bataev <a.bataev@hotmail.com>
Fri, 24 Apr 2015 03:37:03 +0000 (03:37 +0000)
committerAlexey Bataev <a.bataev@hotmail.com>
Fri, 24 Apr 2015 03:37:03 +0000 (03:37 +0000)
commit2cb9b95adf7a46ccb86ead94e4a6002a4fd7aed5
tree9664a0f879a534cfe8e33c597b4312d889941c8e
parent62af99b0db1375a449a7a3771685111d1663e54a
[OPENMP] Codegen for 'firstprivate' clause in 'sections' directive.

If there are 2 or more sections in a 'section' directive the following code is generated:

<init for firstprivates>
@__kmpc_cancel_barrier();// To avoid data race in firstprivate init
@__kmpc_for_static_init_4();
<BODY for sections directive>
@__kmpc_for_static_fini()
If there is only one section, the following code is generated:

if (@__kmpc_single()) {
  <init for firstprivates>
  @__kmpc_end_single();
}
@__kmpc_cancel_barrier(); // To avoid data race in firstprivate init
Differential Revision: http://reviews.llvm.org/D9214

llvm-svn: 235691
clang/lib/CodeGen/CGStmtOpenMP.cpp
clang/test/OpenMP/sections_firstprivate_codegen.cpp [new file with mode: 0644]