diff options
author | Alexey Bataev <a.bataev@hotmail.com> | 2015-04-16 04:54:05 +0000 |
---|---|---|
committer | Alexey Bataev <a.bataev@hotmail.com> | 2015-04-16 04:54:05 +0000 |
commit | 38e8953352c60f0052efa090ee2b18940e3f6ad3 (patch) | |
tree | 3aa241f18280651c24bbb65b1962c7980c88d3a4 /clang/tools/libclang/CIndexCodeCompletion.cpp | |
parent | 4421ac6bf8b9e69a65987a8f4e866464d52c69af (diff) | |
download | bcm5719-llvm-38e8953352c60f0052efa090ee2b18940e3f6ad3.tar.gz bcm5719-llvm-38e8953352c60f0052efa090ee2b18940e3f6ad3.zip |
[OPENMP] Codegen for 'lastprivate' clause in 'for' directive.
#pragma omp for lastprivate(<var>)
for (i = a; i < b; ++b)
<BODY>;
This construct is translated into something like:
<last_iter> = alloca i32
<lastprivate_var> = alloca <type>
<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) {
<var> = <lastprivate_var> ; Update original variable with the lastprivate value.
}
call __kmpc_cancel_barrier() ; an implicit barrier to avoid possible data race.
Differential Revision: http://reviews.llvm.org/D8658
llvm-svn: 235074
Diffstat (limited to 'clang/tools/libclang/CIndexCodeCompletion.cpp')
0 files changed, 0 insertions, 0 deletions