This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] Implement GOMP task reductions
ClosedPublic

Authored by jlpeyton on Mar 17 2021, 12:44 PM.

Details

Summary

Implement the GOMP functions to support task reductions in taskgroup, parallel, loop, and taskloop constructs. The unused mem argument to many of the work-sharing constructs has to do with the implementation of the scan() directive & inscan() modifier. If mem is set, each function will call KMP_FATAL() and tell the user scan/inscan is unsupported. The GOMP reduction implementation is kept separate from our implementation because of how GOMP presents reduction data and computes the reductions.
GOMP expects the privatized copies to be present even after a #pragma omp parallel reduction(task:...) region has ended so the data is stored inside GOMP's uintptr_t* array structure. This style is tightly coupled with GCC compiler codegen. There isn't any init(), combiner(), fini() functions in GOMP's codegen either so the two implementations are too disparate to attempt wrapping GOMP's methods around our own.

Diff Detail

Event Timeline

jlpeyton created this revision.Mar 17 2021, 12:44 PM
jlpeyton requested review of this revision.Mar 17 2021, 12:44 PM
jlpeyton updated this revision to Diff 337528.Apr 14 2021, 12:52 PM

Update tests UNSUPPORTED/XFAIL lines. clang-11 supports task reductions for test task_reduction[2-4].c

Nawrin accepted this revision.Apr 15 2021, 2:25 PM

LGTM

This revision is now accepted and ready to land.Apr 15 2021, 2:25 PM
This revision was landed with ongoing or failed builds.Apr 16 2021, 2:36 PM
This revision was automatically updated to reflect the committed changes.