This is an archive of the discontinued LLVM Phabricator instance.

[NFC][mlir][OpenMP] Added documentation for omp.atomic ops
ClosedPublic

Authored by shraiysh on Dec 9 2021, 6:56 AM.

Details

Summary

This patch adds the documentation for the operations omp.atomic.read,
omp.atomic.write and omp.atomic.update.

Diff Detail

Event Timeline

shraiysh created this revision.Dec 9 2021, 6:56 AM
shraiysh requested review of this revision.Dec 9 2021, 6:56 AM
peixin accepted this revision.Dec 9 2021, 7:09 AM

LGTM with several nits.

mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
583

Please remove "according to the OpenMP Standard". All the materials in this file follow the OpenMP standard. No need to emphasize the point. Also for the following.

610

typo: read -> write.

668

exactly same -> exactly the same?

This revision is now accepted and ready to land.Dec 9 2021, 7:09 AM
shraiysh updated this revision to Diff 393161.Dec 9 2021, 7:29 AM

Addressed comments. Thanks for the review!

shraiysh marked 3 inline comments as done.Dec 9 2021, 7:29 AM

@shraiysh Thanks for the patch. A few nits.

mlir/include/mlir/Dialect/OpenMP/OpenMPOps.td
593

Same here. Please check the following statement from OpenMP 5.0 specification

"If atomic-clause is read then memory-order-clause must not be acq_rel or release"

621

According to OpenMP 5.0 spec, I have noticed the following restriction

"If atomic-clause is write then memory-order-clause must not be acq_rel or acquire."

Can you please check this once?

As this has been merged already, I will change those specific points in a separate patch.