This is an archive of the discontinued LLVM Phabricator instance.

[flang][openacc] Add basic support for derived type component in data operand
ClosedPublic

Authored by clementval on Apr 27 2023, 2:53 PM.

Details

Summary

Add lowering support for derived type component appearing
in a data clause to the newly added data operand operations.

Depends on D149297

Diff Detail

Event Timeline

clementval created this revision.Apr 27 2023, 2:53 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 27 2023, 2:53 PM
clementval requested review of this revision.Apr 27 2023, 2:53 PM

Unify variable names + add extra tests

Remove comment

jeanPerier accepted this revision.Apr 28 2023, 6:48 AM
jeanPerier added inline comments.
flang/lib/Lower/OpenACC.cpp
282

HLFIR will break this pattern recognition. But I do not have better suggestion with the current lowering. When HLFIR is default, we may want to expose an interface that returns the hlfir.designate chain as a list (SmallVector<std::pair<Value, Component>>) given a designator so that no assumptions have to be made here.

Can you add a TODO is this code fails to find a value (it seems all the callers expect a non null value, but I am not sure what is your intention here)?

This revision is now accepted and ready to land.Apr 28 2023, 6:48 AM

Add TODO instead of returning a null value

clementval marked an inline comment as done.Apr 28 2023, 9:59 AM
clementval added inline comments.
flang/lib/Lower/OpenACC.cpp
282

Having the chain will be nice. I'll add a TODO so we can detect when it fails. A null value will make the varPtrPtr to be omitted in the op so the attach semantic would fail.

clementval marked an inline comment as done.

Update information hold into varPtrPtr

clementval updated this revision to Diff 518455.May 1 2023, 8:37 AM

clang-format

razvanlupusoru accepted this revision.May 1 2023, 12:07 PM

Thank you Valentin for the implementation and the detailed tests. The IR looks as expected.

clementval updated this revision to Diff 518563.May 1 2023, 2:20 PM

Remove varPtrPtr for the moment

This revision was landed with ongoing or failed builds.May 1 2023, 4:16 PM
This revision was automatically updated to reflect the committed changes.

Looks good. varPtrPtr is not absolutely vital since FIR can be walked to find all struct parents - it is not as opaque as LLVM's GEP.