This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][Offloading] Remove task wait in nowait interfaces
ClosedPublic

Authored by tianshilei1992 on Jul 30 2021, 7:18 AM.

Details

Summary

All nowait series of interfaces in libomptarget accept four more arguments (int32_t depNum, void *depList, int32_t noAliasDepNum, void *noAliasDepList) compared with their counterparts w/o nowait. These extra arguments were expected for dependence resolution, potentially lowered to device side. Current implementation calls libomp function __kmpc_omp_taskwait. However, the front end simply ignores them, that these four arguments are not emitted at all. As a consequence, the depNum and noAliasDepNum are garbage, which could lead to unnecessary task wait.

Diff Detail

Event Timeline

tianshilei1992 created this revision.Jul 30 2021, 7:18 AM
tianshilei1992 requested review of this revision.Jul 30 2021, 7:18 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 30 2021, 7:18 AM
grokos accepted this revision.Jul 30 2021, 7:37 AM
grokos added a subscriber: grokos.

Now that target nowait operations are handled via hidden helper tasks which make sure that dependencies are satisfied, these calls to __kmpc_omp_taskwait are not only redundant but also hurt performance as they serialize execution unconditionally. LGTM. Can you edit the patch description and explain exactly what you mean and why this patch is needed? Thanks!

This revision is now accepted and ready to land.Jul 30 2021, 7:37 AM
tianshilei1992 edited the summary of this revision. (Show Details)Jul 30 2021, 7:47 AM