This is an archive of the discontinued LLVM Phabricator instance.

[MLIR][OpenMP] Shifted hint from CriticalOp to CriticalDeclareOp
ClosedPublic

Authored by shraiysh on Oct 20 2021, 5:43 AM.

Details

Summary

According to the OpenMP 5.0 standard, names and hints of critical operation are
closely related. The following are the restrictions on them:

  • Unless the effect is as if hint(omp_sync_hint_none) was specified, the critical construct must specify a name.
  • If the hint clause is specified, each of the critical constructs with the same name must have a hint clause for which the hint-expression evaluates to the same value.

These restrictions will be enforced by design if the hint expression is a part
of the omp.critical.declare operation.

  • Any operation with no "name" will be considered to have hint(omp_sync_hint_none).
  • All the operations with the same "name" will have the same hint value.

Diff Detail

Event Timeline

shraiysh created this revision.Oct 20 2021, 5:43 AM
shraiysh requested review of this revision.Oct 20 2021, 5:43 AM

That is a very good observation @shraiysh. Thanks, LGTM.

This revision is now accepted and ready to land.Oct 20 2021, 6:22 AM
shraiysh added a comment.EditedOct 20 2021, 9:04 AM

Thank you @kiranchandramohan for the review. I will land this now.