[PATCH] [OPENMP] Initial codegen for 'parallel for' directive.

Alexey Bataev a.bataev at hotmail.com
Thu Mar 26 05:34:50 PDT 2015


Hi rjmccall, hfinkel, fraggamuffin, ejstotzer,

Allows generation of combined 'parallel for' directive that represents 'parallel' region with internal implicit 'for' worksharing region.
A new combined region RAII is added to the runtime support module, intended to be used for all combined directives, like 'parallel sections', 'parallel for simd' etc.
This RAII region allows to split codegen for combined directives into several independent steps: at first it tries to generate the code for the outher implicit OpenMP region, then for internal. For example, for 'parallel for' directive on first iteration it generates an outlined function for parallel region, and then generates internal loop using information from the outer region. This region stores a kind of implicit directive for which it currently emits code and then advances to the next implicit directive. This allows to reuse the codegen emission method for combined directive for all implicitly included directives just like this:
```
if (<CurrentImplicitRegion> == OMPD_parallel)
  <Generate code for 'parallel' region>
else if (<CurrentImplicitRegion> == OMPD_for>
  <Generate code for 'for' region>
...
```

http://reviews.llvm.org/D8631

Files:
  lib/CodeGen/CGOpenMPRuntime.cpp
  lib/CodeGen/CGOpenMPRuntime.h
  lib/CodeGen/CGStmtOpenMP.cpp
  lib/CodeGen/CodeGenFunction.h
  test/OpenMP/parallel_codegen.cpp
  test/OpenMP/parallel_for_codegen.cpp
  test/OpenMP/sections_codegen.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8631.22709.patch
Type: text/x-patch
Size: 52044 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20150326/7c940ba4/attachment.bin>


More information about the cfe-commits mailing list