This is an archive of the discontinued LLVM Phabricator instance.

[flang][openacc] Generate acc.bound op when local array is passed without subscript
ClosedPublic

Authored by clementval on Apr 26 2023, 2:26 PM.

Details

Summary

Add support to generate the acc.bound operation when the array is passed without
any subscripts. Without this patch, no bound is generated.

Diff Detail

Event Timeline

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

Remove debug code

clementval planned changes to this revision.Apr 26 2023, 2:59 PM

Some tests need an update.

Update older tests with correct bounds

jeanPerier added inline comments.Apr 27 2023, 1:28 AM
flang/lib/Lower/OpenACC.cpp
150–152

I do not follow why the extent is being substracted the lower bound here. Does the acc::DataBoundsOp extent depends on its startIdx argument?

BTW, is "zero" needed here (since it is an optional argument of acc::DataBoundsOp, isn't it implied to be zero when absent)?

clementval added inline comments.Apr 27 2023, 7:50 AM
flang/lib/Lower/OpenACC.cpp
150–152

That a mistake. Let me fix that.

If lbound is zero we can indeed omit it.

clementval planned changes to this revision.Apr 27 2023, 8:44 AM

Fix extent and omit lowerbound

clang-format

razvanlupusoru accepted this revision.Apr 27 2023, 4:24 PM

Thank you for normalizing the representation.

This revision is now accepted and ready to land.Apr 27 2023, 4:24 PM
This revision was landed with ongoing or failed builds.Apr 27 2023, 9:03 PM
This revision was automatically updated to reflect the committed changes.