This is an archive of the discontinued LLVM Phabricator instance.

[flang][OpenMP] Parser support for the unroll construct (5.1)
ClosedPublic

Authored by abidmalikwaterloo on Nov 17 2022, 10:51 AM.

Details

Diff Detail

Event Timeline

Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
abidmalikwaterloo requested review of this revision.Nov 17 2022, 10:51 AM
kiranchandramohan requested changes to this revision.Nov 18 2022, 12:15 AM

There is a clang-format issue with flang/lib/Parser/openmp-parsers.cpp and flang/lib/Parser/unparse.cpp.

You have missed support for the full and partial clauses. For adding support, you will have to make some changes to parse these clauses in flang/lib/Parser/openmp-parsers.cpp and llvm/include/llvm/Frontend/OpenMP/OMP.td.

Please also add tests with these clauses.

flang/test/Parser/omp-unroll.f90
7

Nit: y is unused.

13

Nit: no need for semicolon

15

Nit: no need for semicolon

This revision now requires changes to proceed.Nov 18 2022, 12:15 AM
abidmalikwaterloo marked 3 inline comments as done.Nov 23 2022, 8:49 AM

Added support for the clauses . Added new tests

Herald added a project: Restricted Project. · View Herald TranscriptNov 23 2022, 9:18 AM
kiranchandramohan requested changes to this revision.Nov 23 2022, 3:32 PM

Requesting a change in the OMP.td file. Also, there are clang-format issues.

 clang-format
changed files:
    flang/lib/Parser/openmp-parsers.cpp
    flang/lib/Parser/unparse.cpp
flang/lib/Parser/openmp-parsers.cpp
298

Nit: accidental change?

flang/test/Parser/omp-unroll.f90
9

Nit: check for the partial unroll value as well.

llvm/include/llvm/Frontend/OpenMP/OMP.td
80

The standard says that this is a Compile Time Constant so i guess ScalarIntConstantExpr is the right flangClass here.

where unroll-factor is a positive integer expression that is a compile-time constant.
This revision now requires changes to proceed.Nov 23 2022, 3:32 PM

Ahh! I thought I fixed the clang-format issues. will look into it.

abidmalikwaterloo marked 3 inline comments as done.

Updated the test and took care of the reviewer's comments

kiranchandramohan requested changes to this revision.Jan 1 2023, 2:57 AM

The comment about using scalarIntConstantExpr instead of scalarIntExpr is not yet addressed.

flang/lib/Parser/openmp-parsers.cpp
256

I think scalarIntConstantExpr is the correct one to use here.

llvm/include/llvm/Frontend/OpenMP/OMP.td
80

This comment is not addressed.

This revision now requires changes to proceed.Jan 1 2023, 2:57 AM
abidmalikwaterloo marked 2 inline comments as done.

replace scalarIntExpr with scalarIntConstantExpr.

LGTM. Thanks for your patience. Please update the expectation in the test for the CI and tests to pass before submitting.

flang/test/Parser/omp-unroll.f90
22

The expected value here needs an update.

This revision is now accepted and ready to land.Jan 3 2023, 10:31 AM

Updated the test case omp-unroll.f90

This revision was landed with ongoing or failed builds.Jan 17 2023, 4:38 AM
This revision was automatically updated to reflect the committed changes.