]> granicus.if.org Git - clang/commit
[OPENMP] Private, firstprivate, and lastprivate clauses for distribute, host code...
authorCarlo Bertolli <cbertol@us.ibm.com>
Tue, 3 Jan 2017 18:24:42 +0000 (18:24 +0000)
committerCarlo Bertolli <cbertol@us.ibm.com>
Tue, 3 Jan 2017 18:24:42 +0000 (18:24 +0000)
commitf5be8ba13adc4ba1011a7ccd60c844bd60427c1c
tree0310e501dc6667dc81cc0e2a62095d3fb1224959
parentfb9bfeea738853fc73d0f74fec0f30909beaeb73
[OPENMP] Private, firstprivate, and lastprivate clauses for distribute, host code generation

https://reviews.llvm.org/D17840

This patch enables private, firstprivate, and lastprivate clauses for the OpenMP distribute directive.
Regression tests differ from the similar case of the same clauses on the for directive, by removing a reference to two global variables g and g1. This is necessary because: 1. a distribute pragma is only allowed inside a target region; 2. referring a global variable (e.g. g and g1) in a target region requires the program to enclose the variable in a "declare target" region; 3. declare target pragmas, which are used to define a declare target region, are currently unavailable in clang (patch being prepared).
For this reason, I moved the global declarations into local variables.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@290898 91177308-0d34-0410-b5e6-96231b3b80d8
lib/CodeGen/CGStmtOpenMP.cpp
test/OpenMP/distribute_lastprivate_codegen.cpp [new file with mode: 0644]
test/OpenMP/distribute_private_codegen.cpp [new file with mode: 0644]