llvm-project/clang/tools
Alexey Bataev 38e8953352 [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
2015-04-16 04:54:05 +00:00
..
arcmt-test Revert "Wrap clang module files in a Mach-O, ELF, or COFF container." 2015-02-25 02:44:04 +00:00
c-arcmt-test Revert "Wrap clang module files in a Mach-O, ELF, or COFF container." 2015-02-25 02:44:04 +00:00
c-index-test [libclang] Add functions to get information about fields. 2015-04-13 16:55:04 +00:00
clang-check Revert "Wrap clang module files in a Mach-O, ELF, or COFF container." 2015-02-25 02:44:04 +00:00
clang-format clang-format: Recognize the .ts (TypeScript) extension as JavaScript. 2015-03-11 14:58:38 +00:00
clang-format-vs Migrate clang-format-vs plugin project to VS 2013 2015-03-03 17:30:50 +00:00
clang-fuzzer Gating clang-fuzzer on the same conditions required to build the LLVMFuzzer library. Otherwise, we can run into a situation where clang-fuzzer attempts to build, but its dependency was never built. 2015-04-06 16:10:32 +00:00
diag-build Briefly document diag-build.sh 2013-12-28 21:59:11 +00:00
diagtool Revert "Wrap clang module files in a Mach-O, ELF, or COFF container." 2015-02-25 02:44:04 +00:00
driver Use raw_pwrite_stream in clang. 2015-04-14 15:15:49 +00:00
libclang [OPENMP] Codegen for 'lastprivate' clause in 'for' directive. 2015-04-16 04:54:05 +00:00
scan-build [scan-build] Be friendly to "" in the argument list. 2015-03-28 02:17:21 +00:00
scan-view [analyzer] scan-view: don't ever serve absolute paths. 2013-04-29 17:23:06 +00:00
CMakeLists.txt Add initial version of a clang-fuzzer. 2015-03-28 00:07:39 +00:00
Makefile Make clang's rewrite engine a core feature 2014-07-16 16:48:33 +00:00