Page MenuHomePhabricator

[flang][openacc] Semantic check for cache directive
ClosedPublic

Authored by clementval on Oct 26 2020, 12:07 PM.

Details

Summary

Add semantic check for the cache directive. According to section 2.10 from the specification:
A var in a cache directive must be a single array element or a simple subarray.

Diff Detail

Event Timeline

clementval created this revision.Oct 26 2020, 12:07 PM
Herald added a project: Restricted Project. · View Herald TranscriptOct 26 2020, 12:07 PM
clementval requested review of this revision.Oct 26 2020, 12:07 PM
clementval added a project: Restricted Project.Oct 26 2020, 12:40 PM
flang/lib/Semantics/resolve-directives.cpp
491–501

#just-saying: It will be useful if there is some general guidelines on when to use evaluate::DataRef.

flang/test/Semantics/acc-clause-validity.f90
665

Can you add one more test with arr(1:5)%s?

clementval marked 2 inline comments as done.Nov 24 2020, 12:54 PM
clementval added inline comments.
flang/lib/Semantics/resolve-directives.cpp
491–501

Sure, maybe adding something in the semantic check documentation would make sense. What do you think?

flang/test/Semantics/acc-clause-validity.f90
665

I added couple of tests in that sense arr(1:5)%s is not possible since arr and s are member of t at the same level.

clementval marked 2 inline comments as done.

Rebase + add couple of test cases

LGTM.

flang/lib/Semantics/resolve-directives.cpp
491–501

Yes, that would be great.

This revision is now accepted and ready to land.Nov 25 2020, 1:01 AM
This revision was automatically updated to reflect the committed changes.
clementval marked an inline comment as done.Nov 25 2020, 7:28 AM
clementval added inline comments.
flang/lib/Semantics/resolve-directives.cpp
491–501

Ok. Added on my todo list. I'll send this as a separate patch.