[PATCH] D28781: [OpenMP] Support for the if-clause on the combined directive 'target parallel'.

Arpith Jacob via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Jan 16 14:28:18 PST 2017


arpith-jacob created this revision.

The if-clause on the combined directive potentially applies to both the
'target' and the 'parallel' regions. Codegen'ing the if-clause on the
combined directive requires additional support because the expression in
the clause must be captured by the 'target' capture statement but not
the 'parallel' capture statement. Note that this situation arises for
other clauses such as num_threads.

The OMPIfClause class inherits OMPClauseWithPreInit to support capturing
of expressions in the clause. A member CaptureRegion is added to
OMPClauseWithPreInit to indicate the innermost captured statement (in this
case 'target' but not 'parallel') that captures these expressions.

To ensure correct codegen of captured expressions in the presence of
'parallel' combined with 'target', OMPParallelScope was added to 'parallel'
codegen.


https://reviews.llvm.org/D28781

Files:
  include/clang/AST/OpenMPClause.h
  include/clang/AST/RecursiveASTVisitor.h
  lib/AST/OpenMPClause.cpp
  lib/AST/StmtProfile.cpp
  lib/CodeGen/CGStmtOpenMP.cpp
  lib/Sema/SemaOpenMP.cpp
  lib/Serialization/ASTReaderStmt.cpp
  lib/Serialization/ASTWriterStmt.cpp
  test/OpenMP/target_parallel_if_codegen.cpp
  tools/libclang/CIndex.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28781.84597.patch
Type: text/x-patch
Size: 37053 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170116/f1cb49e6/attachment-0001.bin>


More information about the cfe-commits mailing list