This is an archive of the discontinued LLVM Phabricator instance.

[Clang][OpenMP] Remove the mandatory flush for capture for OpenMP 5.1
ClosedPublic

Authored by tianshilei1992 on Apr 19 2021, 8:34 AM.

Details

Summary

In OpenMP 5.1:

If the write or update clause is specifieded, the atomic operation is not an atomic conditional update for which the comparison fails, and the effective memory ordering is release, acq_rel, or seq_cst, the strong flush on entry to the atomic operation is also a release flush. If the read or update clause is specified and the effective memory ordering is acquire, acq_rel, or seq_cst then the strong flush on exit from the atomic operation is also an acquire flush.

In OpenMP 5.0:

If the write, update, or capture clause is specified and the release, acq_rel, or seq_cst clause is specified then the strong flush on entry to the atomic operation is also a release flush. If the read or capture clause is specified and the acquire, acq_rel, or seq_cst clause is specified then the strong flush on exit from the atomic operation is also an acquire flush.

From my understanding, in OpenMP 5.1, capture is removed from the requirement for flush, therefore we don't have to enforce it.

Diff Detail

Event Timeline

tianshilei1992 created this revision.Apr 19 2021, 8:34 AM
tianshilei1992 requested review of this revision.Apr 19 2021, 8:34 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2021, 8:34 AM

rebase and ping

This revision is now accepted and ready to land.Jul 23 2021, 5:58 PM
tianshilei1992 edited the summary of this revision. (Show Details)Jul 23 2021, 6:09 PM
tianshilei1992 edited the summary of this revision. (Show Details)Jul 23 2021, 6:11 PM
tianshilei1992 edited the summary of this revision. (Show Details)

@ABataev I updated the description. If you agree with my understanding, I'll land it.

@ABataev I updated the description. If you agree with my understanding, I'll land it.

Still LGTM

This revision was landed with ongoing or failed builds.Jul 26 2021, 8:00 AM
This revision was automatically updated to reflect the committed changes.