diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-04-27 04:34:03 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-04-27 04:34:03 +0000 |
commit | 9efc03b6f7666e4d51627ed2e0198747769d091e (patch) | |
tree | 8f3add3ef27d1b08c6c8e0b989a4c4fdfc806009 /clang/test/OpenMP/taskwait_codegen.cpp | |
parent | 7387083d95d595f4d5e883bd4cb20781c1b4e72b (diff) | |
download | llvm-9efc03b6f7666e4d51627ed2e0198747769d091e.zip llvm-9efc03b6f7666e4d51627ed2e0198747769d091e.tar.gz llvm-9efc03b6f7666e4d51627ed2e0198747769d091e.tar.bz2 |
[OPENMP] Codegen for 'lastprivate' clause in 'sections' directive.
#pragma omp sections lastprivate(<var>)
<BODY>;
This construct is translated into something like:
<last_iter> = alloca i32
<init for lastprivates>;
<last_iter> = 0
; No initializer for simple variables or a default constructor is called for objects.
; For arrays perform element by element initialization by the call of the default constructor.
...
OMP_FOR_START(...,<last_iter>, ..); sets <last_iter> to 1 if this is the last iteration.
<BODY>
...
OMP_FOR_END
if (<last_iter> != 0) {
<final copy for lastprivate>; Update original variable with the lastprivate value.
}
call __kmpc_cancel_barrier() ; an implicit barrier to avoid possible data race.
If there is only one section, there is no special code generation, original shared variables are used + barrier is emitted at the end of the directive.
Differential Revision: http://reviews.llvm.org/D9240
llvm-svn: 235834
Diffstat (limited to 'clang/test/OpenMP/taskwait_codegen.cpp')
0 files changed, 0 insertions, 0 deletions