This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP][Flang][Semantics] Add semantics support for USE_DEVICE_ADDR clause on OMP TARGET DATA directive.
ClosedPublic

Authored by raghavendhra on May 3 2023, 10:16 PM.

Diff Detail

Event Timeline

raghavendhra created this revision.May 3 2023, 10:16 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
raghavendhra requested review of this revision.May 3 2023, 10:16 PM

Rebasing the patch.

clementval added inline comments.May 8 2023, 8:39 AM
flang/test/Semantics/OpenMP/use_device_ptr.f90
15 ↗(On Diff #520385)

This change seems related to use_device_ptr

raghavendhra added inline comments.May 8 2023, 8:43 AM
flang/test/Semantics/OpenMP/use_device_ptr.f90
15 ↗(On Diff #520385)

Yes, I missed this additional check in previous commit so adding it here. Is that okay?

clementval added inline comments.May 8 2023, 8:58 AM
flang/lib/Semantics/resolve-directives.cpp
520

What is the plan here? I mean do you plan to use these flags in the lowering somehow or do you just replicate what was done for other clauses?

flang/test/Semantics/OpenMP/use_device_ptr.f90
15 ↗(On Diff #520385)

It might be better to do it in a separate patch since it is unrelated to this one.

raghavendhra marked an inline comment as done.May 8 2023, 9:54 AM
raghavendhra added inline comments.
flang/lib/Semantics/resolve-directives.cpp
520

I added UseDeviceAddr flag because of the following description from OpenMP 5.1 spec

"If a list item that appears in a use_device_addr clause has corresponding storage in the device data environment, references to the list item in the associated structured block are converted into references to the corresponding list item"

Plan is to have UseDeviceAddr flag set so that we can use it in lowering. Also, replicating the behavior of private clause.

Removed changes to use_device_ptr.f90 test and will submit that as separate patch

This revision is now accepted and ready to land.May 9 2023, 3:46 PM

Rebase before commit.

This revision was landed with ongoing or failed builds.May 10 2023, 5:17 PM
This revision was automatically updated to reflect the committed changes.