a4dd85e015
This patch adds support for custom allocators on private/firstprivate clauses for task (and taskloop) constructs. Private didn't need anything special, but firstprivate if it is passed by reference needs the GOMP_alloc calls in the copyfn and GOMP_free in the task body. 2020-11-14 Jakub Jelinek <jakub@redhat.com> * gimplify.c (gimplify_omp_for): Add OMP_CLAUSE_ALLOCATE_ALLOCATOR decls as firstprivate on task clauses even when allocate clause decl is not lastprivate. * omp-low.c (install_var_field): Don't dereference omp_is_reference types if mask is 33 rather than 1. (scan_sharing_clauses): Populate allocate_map even for task constructs. For now remove it back for variables mentioned in reduction and in_reduction clauses on task/taskloop constructs or on VLA task firstprivates. For firstprivate on task construct, install the var field into field_map with by_ref and 33 instead of false and 1 if mentioned in allocate clause. (lower_private_allocate): Set TREE_THIS_NOTRAP on the created MEM_REF. (lower_rec_input_clauses): Handle allocate for task firstprivatized non-VLA variables. (create_task_copyfn): Likewise. * testsuite/libgomp.c-c++-common/allocate-1.c (struct S): New type. (foo): Add tests for non-VLA private and firstprivate clauses on omp task. (bar): Likewise. Remove taking of address from private/firstprivate variables. * testsuite/libgomp.c++/allocate-1.C (struct S): New type. (foo): Add p, q, px and s arguments. Add tests for array reductions and for non-VLA private and firstprivate clauses on omp task. (bar): Removed. (main): Adjust foo caller. Don't call bar. |
||
---|---|---|
.. | ||
alloc-1.c | ||
alloc-2.c | ||
alloc-3.c | ||
alloc-4.c | ||
allocate-1.c | ||
atomic-18.c | ||
cancel-parallel-1.c | ||
cancel-taskgroup-1.c | ||
cancel-taskgroup-2.c | ||
cancel-taskgroup-3.c | ||
cancel-taskgroup-4.c | ||
critical-hint-1.c | ||
critical-hint-2.c | ||
depend-iterator-1.c | ||
depend-iterator-2.c | ||
depend-mutexinout-1.c | ||
depend-mutexinout-2.c | ||
depobj-1.c | ||
display-affinity-1.c | ||
for-1.c | ||
for-1.h | ||
for-2.c | ||
for-2.h | ||
for-3.c | ||
for-4.c | ||
for-5.c | ||
for-6.c | ||
for-7.c | ||
for-8.c | ||
for-9.c | ||
for-10.c | ||
for-11.c | ||
for-12.c | ||
for-13.c | ||
for-14.c | ||
for-15.c | ||
for-16.c | ||
function-not-offloaded-aux.c | ||
function-not-offloaded.c | ||
lastprivate-conditional-1.c | ||
lastprivate-conditional-2.c | ||
lastprivate-conditional-3.c | ||
lastprivate-conditional-4.c | ||
lastprivate-conditional-5.c | ||
lastprivate-conditional-6.c | ||
lastprivate-conditional-7.c | ||
lastprivate-conditional-8.c | ||
lastprivate-conditional-9.c | ||
lastprivate-conditional-10.c | ||
loop-1.c | ||
loop-13.c | ||
loop-14.c | ||
loop-15.c | ||
master-combined-1.c | ||
monotonic-1.c | ||
monotonic-2.c | ||
nested-parallel-unbalanced.c | ||
nonmonotonic-1.c | ||
nonmonotonic-2.c | ||
ordered-4.c | ||
pause-1.c | ||
pause-2.c | ||
pr45784.c | ||
pr64824.c | ||
pr64868.c | ||
pr66199-1.c | ||
pr66199-2.c | ||
pr66199-3.c | ||
pr66199-4.c | ||
pr66199-5.c | ||
pr66199-6.c | ||
pr66199-7.c | ||
pr66199-8.c | ||
pr66199-9.c | ||
pr66199-10.c | ||
pr66199-11.c | ||
pr66199-12.c | ||
pr66199-13.c | ||
pr66199-14.c | ||
pr69389.c | ||
pr81875.c | ||
pr83046.c | ||
pr93515.c | ||
pr96390.c | ||
ptr-attach-1.c | ||
reduction-16.c | ||
simd-1.c | ||
simd-14.c | ||
simd-15.c | ||
simd-16.c | ||
simd-17.c | ||
target-1.c | ||
target-2.c | ||
target-10.c | ||
target-13.c | ||
target-40.c | ||
task-reduction-1.c | ||
task-reduction-2.c | ||
task-reduction-3.c | ||
task-reduction-4.c | ||
task-reduction-5.c | ||
task-reduction-6.c | ||
task-reduction-7.c | ||
task-reduction-8.c | ||
task-reduction-9.c | ||
task-reduction-11.c | ||
task-reduction-12.c | ||
task-reduction-13.c | ||
task-reduction-14.c | ||
taskgroup-1.c | ||
taskloop-1.c | ||
taskloop-2.c | ||
taskloop-3.c | ||
taskloop-4.c | ||
taskloop-reduction-1.c | ||
taskloop-reduction-2.c | ||
taskloop-reduction-3.c | ||
taskloop-reduction-4.c | ||
taskwait-depend-1.c | ||
udr-1.c | ||
unmap-infinity-2.c | ||
variable-not-offloaded.c |