This is an archive of the discontinued LLVM Phabricator instance.

[mlir][openacc] Refine data operation data clause attribute
ClosedPublic

Authored by razvanlupusoru on Apr 19 2023, 11:13 AM.

Details

Summary

The data operations added in D148389 hold two data clause fields:
"dataClause" and "decomposedFrom". However, in most cases, dataClause
field holds a default value (except for acc_copyin_readonly,
acc_create_zero, and acc_copyout_zero).

The decomposedFrom field holds the original clause specified by user.
As work began on lowering to these new operations [1], it seems that
having both fields adds a bit of ambiguity. There is only one scenario
where we actually intended to use both:
acc data copyout(zero:)

The original intent was that this clause would be decomposed to
the following operations:
acc.create {dataClause = acc_create_zero, decomposedFrom =
acc_copyout_zero}
...
acc.copyout {dataClause = acc_copyout_zero}

However, we can encode the zero semantics like so without need of both:
acc.create {dataClause = acc_copyout_zero}
...
acc.copyout {dataClause = acc_copyout_zero}

Thus get rid of the decomposedFrom field and update verifier checks
to check for all data clauses that can be decomposed to the particular
operation.

So now the dataClause holds the original user's clause which simplifies
understanding of the operation.

[1] https://reviews.llvm.org/D148721

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptApr 19 2023, 11:13 AM
razvanlupusoru requested review of this revision.Apr 19 2023, 11:13 AM

Added missing comment for detach verifier.

This revision is now accepted and ready to land.Apr 19 2023, 11:16 AM
This revision was landed with ongoing or failed builds.Apr 19 2023, 3:06 PM
This revision was automatically updated to reflect the committed changes.