This is an archive of the discontinued LLVM Phabricator instance.

[flang][openacc] Semantic checks for OpenACC 3.0 clauses validity
ClosedPublic

Authored by clementval on Jul 14 2020, 12:46 PM.

Details

Summary

This patch adds semantic checking for the OpenACC 3.0 clauses validity.

Diff Detail

Event Timeline

clementval created this revision.Jul 14 2020, 12:46 PM
Herald added a project: Restricted Project. · View Herald TranscriptJul 14 2020, 12:46 PM

There are couple of things where we could share code with OpenMP. I'm thinking about the OmpContext/AccContext and code around it. If reviewers think it makes sense I'm happy to do this in this patch or in a follow up patch.

clementval added a project: Restricted Project.Jul 14 2020, 1:01 PM
klausler accepted this revision.Jul 14 2020, 1:06 PM

Looks great to me! Thanks for this work. Please take a look at my minor comments.

flang/lib/Semantics/canonicalize-acc.cpp
42

Can be const, or (better) static, or (best) in parser/tools.h.

flang/lib/Semantics/check-acc-structure.cpp
87

If these are placeholders, please add a comment; otherwise, consider removing them.

115

The nested scopes here aren't necessary.

212

Perhaps this would be more readable as an if statement.

449

// comments are preferred

502

Please add a newline to the end of this source file.

This revision is now accepted and ready to land.Jul 14 2020, 1:06 PM
tskeith added inline comments.Jul 14 2020, 2:01 PM
flang/lib/Semantics/canonicalize-acc.cpp
37

You should be able to simplify this by using parser::Unwrap here. That is,
auto *accLoop{parser::Unwrap<parser::OpenACCLoopConstruct>(*it)

70

Can use parser::Unwrap here too.

clementval marked 7 inline comments as done.

Address minor review comments

clementval marked 2 inline comments as done.Jul 14 2020, 5:03 PM

Thanks for the review. All comments were addressed. Thanks for the parser::Unwrap, didn't know this one.

flang/lib/Semantics/canonicalize-acc.cpp
42

Not necessary anymore with parser::Unwrap

tskeith accepted this revision.Jul 14 2020, 5:34 PM
This revision was automatically updated to reflect the committed changes.
clementval marked an inline comment as done.