Recommit of
authorCarlo Bertolli <cbertol@us.ibm.com>
Tue, 25 Apr 2017 17:52:12 +0000 (17:52 +0000)
committerCarlo Bertolli <cbertol@us.ibm.com>
Tue, 25 Apr 2017 17:52:12 +0000 (17:52 +0000)
commitb0ff0a69c32487bc109c4d1203bfa239c5aedf0f
tree6b64cff3f6245c2c164bfe7c68d83fdeecaf2fa2
parent44f6ea881822da3249d27fff1e0e892a8b7afb46
Recommit of
[OpenMP] Initial implementation of code generation for pragma 'distribute parallel for' on host

https://reviews.llvm.org/D29508

This patch makes the following additions:

It abstracts away loop bound generation code from procedures associated with pragma 'for' and loops in general, in such a way that the same procedures can be used for 'distribute parallel for' without the need for a full re-implementation.
It implements code generation for 'distribute parallel for' and adds regression tests. It includes tests for clauses.
It is important to notice that most of the clauses are implemented as part of existing procedures. For instance, firstprivate is already implemented for 'distribute' and 'for' as separate pragmas. As the implementation of 'distribute parallel for' is based on the same procedures, then we automatically obtain implementation for such clauses without the need to add new code. However, this requires regression tests that verify correctness of produced code.

llvm-svn: 301340
clang/lib/CodeGen/CGOpenMPRuntime.cpp
clang/lib/CodeGen/CGOpenMPRuntime.h
clang/lib/CodeGen/CGStmtOpenMP.cpp
clang/lib/CodeGen/CodeGenFunction.h
clang/test/OpenMP/distribute_parallel_for_codegen.cpp [new file with mode: 0644]
clang/test/OpenMP/distribute_parallel_for_firstprivate_codegen.cpp [new file with mode: 0644]
clang/test/OpenMP/distribute_parallel_for_if_codegen.cpp [new file with mode: 0644]
clang/test/OpenMP/distribute_parallel_for_lastprivate_codegen.cpp [new file with mode: 0644]
clang/test/OpenMP/distribute_parallel_for_num_threads_codegen.cpp [new file with mode: 0644]
clang/test/OpenMP/distribute_parallel_for_private_codegen.cpp [new file with mode: 0644]
clang/test/OpenMP/distribute_parallel_for_proc_bind_codegen.cpp [new file with mode: 0644]