This is an archive of the discontinued LLVM Phabricator instance.

[flang][OpenMP] Added parser support for defaultmap (OpenMP 5.0)
ClosedPublic

Authored by do on Apr 21 2022, 11:39 AM.

Details

Diff Detail

Event Timeline

do created this revision.Apr 21 2022, 11:39 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 21 2022, 11:39 AM
do requested review of this revision.Apr 21 2022, 11:39 AM
do removed a reviewer: jdoerfert.Apr 21 2022, 11:43 AM
do removed a project: Restricted Project.
do removed subscribers: yaxunl, guansong, sstefan1.
Herald added a project: Restricted Project. · View Herald Transcript
do updated this revision to Diff 424260.Apr 21 2022, 11:57 AM
do removed a reviewer: jdoerfert.
kiranchandramohan requested changes to this revision.Apr 25 2022, 5:23 AM

Thanks @do for this patch. I have two comments.

  1. I think the linux CI is failing since the patch is not formatted. Can you run clang-format on the two source files (flang/include/flang/Parser/parse-tree.h, flang/lib/Parser/openmp-parsers.cpp)? Since we build clang also along with flang you likely have clang-format as well in your bin.
./bin/clang-format -i <path-to-filename>
  1. Can you also add a parse-tree dump test similar to what is in the following file? This is just to check that the parse-tree created is correct and it is easier for the reviewers to see the parse-tree.

https://github.com/llvm/llvm-project/blob/main/flang/test/Parser/omp-sections.f90

This revision now requires changes to proceed.Apr 25 2022, 5:23 AM
do updated this revision to Diff 425020.Apr 25 2022, 1:53 PM

Thanks @do for this patch. I have two comments.

  1. I think the linux CI is failing since the patch is not formatted. Can you run clang-format on the two source files (flang/include/flang/Parser/parse-tree.h, flang/lib/Parser/openmp-parsers.cpp)? Since we build clang also along with flang you likely have clang-format as well in your bin.
./bin/clang-format -i <path-to-filename>
  1. Can you also add a parse-tree dump test similar to what is in the following file? This is just to check that the parse-tree created is correct and it is easier for the reviewers to see the parse-tree.

https://github.com/llvm/llvm-project/blob/main/flang/test/Parser/omp-sections.f90

Thanks @kiranchandramohan! Both are addressed.

CI fails. Can you check it?

peixin added inline comments.Apr 26 2022, 12:03 AM
flang/include/flang/Parser/parse-tree.h
3346

The comment needs changes since you are extending 4.5 to 5.0.

3351

I guess the CI fails for the test case since Aggregate cannot be recognized. Please check it.

do added a comment.Apr 26 2022, 3:23 AM

CI fails. Can you check it?

thanks @peixin! will do.

do updated this revision to Diff 425195.Apr 26 2022, 6:05 AM

Addressed comments. Should fix the CI failures as well.

do added inline comments.Apr 26 2022, 6:07 AM
flang/include/flang/Parser/parse-tree.h
3346

will do. thanks.

3351

will do. thanks.

peixin added inline comments.Apr 27 2022, 6:08 PM
flang/lib/Parser/openmp-parsers.cpp
55–59

Please remove this previous comment.

59
do marked 2 inline comments as done.Apr 27 2022, 6:35 PM
do added inline comments.
flang/lib/Parser/openmp-parsers.cpp
55–59

Will do. Thanks.

do updated this revision to Diff 425675.Apr 27 2022, 6:40 PM
do marked an inline comment as done.

addressing comments.

do updated this revision to Diff 425719.Apr 28 2022, 2:01 AM
do marked 2 inline comments as done.

Thanks Dossay for the contribution. LGTM with the two Nits suggested and CI passing. Please wait for @shraiysh and @peixin to approve.

flang/test/Parser/omp-defaultmap-unparse.f90
36–57

Nit: For the unparse tests only the relevant section is required. You can remove the checks for the rest from all the tests.
For e.g for this test, the relevant section is the following.

!PARSE-TREE:      OmpBeginBlockDirective
!PARSE-TREE:        OmpBlockDirective -> llvm::omp::Directive = target
!PARSE-TREE:        OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
!PARSE-TREE:          ImplicitBehavior = Tofrom
!PARSE-TREE:          VariableCategory = Scalar
255–280

Nit: I think you can move these entries also close to the individual tests.

This revision is now accepted and ready to land.Apr 28 2022, 2:19 AM
do updated this revision to Diff 425737.Apr 28 2022, 3:11 AM

Thanks Dossay for the contribution. LGTM with the two Nits suggested and CI passing. Please wait for @shraiysh and @peixin to approve.

Thanks Kiran! Done.

do marked 2 inline comments as done.Apr 28 2022, 3:13 AM
flang/test/Parser/omp-defaultmap-unparse.f90
43–56

@do I meant you can remove the check for Block and OmpEndBlockDirective and just have the following.

!PARSE-TREE:      OmpBeginBlockDirective
!PARSE-TREE:        OmpBlockDirective -> llvm::omp::Directive = target
!PARSE-TREE:        OmpClauseList -> OmpClause -> Defaultmap -> OmpDefaultmapClause
!PARSE-TREE:          ImplicitBehavior = Tofrom
!PARSE-TREE:          VariableCategory = Scalar
peixin added inline comments.Apr 28 2022, 4:13 AM
flang/include/flang/Parser/parse-tree.h
3346

This change is missed.

do updated this revision to Diff 425765.Apr 28 2022, 6:40 AM

addressing comments.

do marked 2 inline comments as done.Apr 28 2022, 6:41 AM
peixin accepted this revision.May 2 2022, 5:35 AM
shraiysh accepted this revision.EditedMay 6 2022, 4:17 AM

LGTM, thank you for working on this and apologies for the delay in review.

Is this landed?

do added a comment.May 19 2022, 7:43 AM

Is this landed?

Thanks @peixin for checking, working on it. Will update when done.

@do I am trying to land this patch for you as you suggested, but I need your email address to make you the author of this patch. I believe this patch was uploaded via the web interface and so it doesn't have your email address tied to it.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptJun 1 2022, 12:23 AM