This is an archive of the discontinued LLVM Phabricator instance.

[flang][openacc] Add parsing support for dim in gang clause
ClosedPublic

Authored by clementval on Jun 1 2023, 10:47 PM.

Details

Diff Detail

Event Timeline

clementval created this revision.Jun 1 2023, 10:47 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
clementval requested review of this revision.Jun 1 2023, 10:47 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2023, 10:47 PM
Anastasia added inline comments.
flang/test/Parser/acc-unparse.f90
57

Btw dim and num should not appear together, s2.9.2 paragraph 1 says:

The dim argument must be a constant positive integer with value 1, 2, or 3. <...> The number of gangs in dimension d is controlled by the parallel construct; the num argument is not allowed.

There are a number of other restrictions, for example the value of dim can only be an integer literal in the range 1-3 and it has to appear only once. But maybe you plan to add the diagnostics later?

clementval added inline comments.Jun 4 2023, 5:23 PM
flang/test/Parser/acc-unparse.f90
57

Thanks for catching this! I overlooked these restrictions when I checked the spec.
I’ll at least update this patch with the num argument is not allowed here. I might do another patch for the remaining restrictions.

Add semantic check

clementval marked an inline comment as done.Jun 12 2023, 3:04 PM
jeanPerier accepted this revision.Jun 13 2023, 6:34 AM

Looks great, please double check/rebase, but I think the buildbot failures are unrelated to your patch.

This revision is now accepted and ready to land.Jun 13 2023, 6:34 AM
razvanlupusoru accepted this revision.Jun 13 2023, 8:15 AM

Looks great!

clang-format :)

This revision was landed with ongoing or failed builds.Jun 13 2023, 8:33 PM
This revision was automatically updated to reflect the committed changes.