[PATCH] [OPENMP] Fixed codegen for 'schedule' clause with non-constant chunk size.

Alexey Bataev a.bataev at hotmail.com
Fri May 8 06:43:13 PDT 2015


Hi rjmccall, hfinkel,

There are troubles with codegen for 'schedule' clause with non-constant chunk size in combined directives like 'omp parallel for'. Currently, all variables, used in this chunk expression, must be captured and passed to outlined function for implicit 'parallel' region. But this does not happen because this expression is generated outside of 'parallel for' directive region and it causes compiler crash.
The codegen is changed so, that if non-constant chunk size is found, it is evaluated outside of OpenMP region and the value is stored into private global variable. When loop directive needs this schedule chunk, it just loads the value stored inside this global variable and uses it as a chunk size.

http://reviews.llvm.org/D9606

Files:
  lib/CodeGen/CGStmtOpenMP.cpp
  lib/CodeGen/CodeGenFunction.h
  test/OpenMP/for_codegen.cpp
  test/OpenMP/parallel_for_codegen.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D9606.25323.patch
Type: text/x-patch
Size: 7389 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150508/17b3459a/attachment.bin>


More information about the cfe-commits mailing list