This is an archive of the discontinued LLVM Phabricator instance.

[flang][openacc] Fix the value of lower bound, upper bound and extent
ClosedPublic

Authored by clementval on Apr 21 2023, 9:12 AM.

Details

Summary

Update the lowering to match the intent of the newly added operation
as described here D148860.

Diff Detail

Event Timeline

clementval created this revision.Apr 21 2023, 9:12 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 21 2023, 9:12 AM
clementval requested review of this revision.Apr 21 2023, 9:12 AM

Thank you for addressing this issue. For default lb of 1, the acc.bounds operation appears to work as intended.
However, would this work for the case of "integer :: array(0:9)" or similarly non-1 constant lowerbound?

Thank you for addressing this issue. For default lb of 1, the acc.bounds operation appears to work as intended.
However, would this work for the case of "integer :: array(0:9)" or similarly non-1 constant lowerbound?

Let me add couple of tests for these cases.

Add test for array section from array with non default lower bound. Update the
code to support these cases correctly.

clementval added inline comments.Apr 21 2023, 11:45 AM
flang/lib/Lower/OpenACC.cpp
134

The special case here will be merge with the non constant bound support so the code will hopefully look better.

razvanlupusoru accepted this revision.Apr 21 2023, 12:21 PM

I went pretty meticulously through the tests and everything looks correct. Thank you for all the detail on writing these tests.

This revision is now accepted and ready to land.Apr 21 2023, 12:21 PM

clang-format

This revision was landed with ongoing or failed builds.Apr 21 2023, 1:23 PM
This revision was automatically updated to reflect the committed changes.