]> granicus.if.org Git - clang/commit
[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)
commit8cd55277405d7b38419ef7a6c6b5c6695277312c
tree8e3cd334b97165db7bbf13dd82b239d2e717f400
parent3fb626d1f815b94bb2110fa04ba5b903e064659f
[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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@235691 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGStmtOpenMP.cpp
test/OpenMP/sections_firstprivate_codegen.cpp [new file with mode: 0644]