This is an archive of the discontinued LLVM Phabricator instance.

[Flang][Openmp] Upgrade TASKGROUP construct to 5.0.
ClosedPublic

Authored by AMDChirag on Dec 15 2020, 11:00 PM.

Details

Summary

In OMP 5.0 specification clause-list with

  • task_reduction
  • allocate

were allowed on taskgroup construct.

Also updates some Clang test cases to use OpenMP 5.0

Fix XFAIL - omp-taskloop01.f90.

Patch created originally by @sameeranjoshi

Diff Detail

Event Timeline

sameeranjoshi created this revision.Dec 15 2020, 11:00 PM
sameeranjoshi requested review of this revision.Dec 15 2020, 11:00 PM
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: sstefan1. · View Herald Transcript

Fix newlines.

sameeranjoshi added a project: Restricted Project.Dec 15 2020, 11:17 PM
clementval added inline comments.Dec 16 2020, 6:47 AM
flang/lib/Lower/OpenMP.cpp
242 ↗(On Diff #312119)

If you add the todo can you maybe explicitly add an error message in it?

flang/test/Semantics/omp-taskgroup01.f90
37

Why is this block commented out?

sameeranjoshi added inline comments.Dec 16 2020, 10:27 AM
flang/lib/Lower/OpenMP.cpp
242 ↗(On Diff #312119)

What in case we remove it, that's ok is it?

flang/test/Semantics/omp-taskgroup01.f90
37

Depends on D93105

clementval added inline comments.Dec 16 2020, 10:58 AM
flang/lib/Lower/OpenMP.cpp
242 ↗(On Diff #312119)

Fine as well. In the current state it doesn't add more.

flang/test/Semantics/omp-taskgroup01.f90
37

Yeah but since you have it as a dependency in phab you can uncomment the block.

clementval added inline comments.Dec 16 2020, 4:34 PM
flang/test/Semantics/omp-taskgroup01.f90
37

What I mean is that the pre-merge check for example will apply the patch you depend on before applying this one so you will not have failure.

Address review comments.

flang/test/Semantics/omp-taskgroup01.f90
40

A colon (not comma) is expected right?

flang/test/Semantics/omp-taskgroup01.f90
38

reduction_var is not declared?

49

Should this be taskgroup or is this accidentally added?

52

Check count of begin and end taskgroups.

Summary of changes:

  • Simplify the test as those checks were already covered.
  • Update OMP.td to specifiy to add 5.0 standard for the clauses.

Rebase after task_reduction(D93105).

sameeranjoshi marked 7 inline comments as done.Jan 12 2021, 11:47 AM

These are great catches, thank you.
I was wondering since the merge of task_reduction why were the tests failing and did kept this on hold for a while since then.
Thanks again. :)

flang/test/Semantics/omp-taskgroup01.f90
40

Ideally it was supposed to be caught in parser itself, unfortunately it didn't.
May be this needs to be investigated in new patch.

sameeranjoshi marked an inline comment as done.Jan 19 2021, 9:41 AM

Ping.

llvm/include/llvm/Frontend/OpenMP/OMP.td
476–477

Are tests failing due to task_reduction/allocate marked as version 5.0?

sameeranjoshi added inline comments.Jan 19 2021, 10:34 AM
llvm/include/llvm/Frontend/OpenMP/OMP.td
476–477

All clang related OpenMP tests are failing which contain flag -fopenmp-version=45 for compilation along with -fopenmp.
The difference of 4.5 and 5.0 specifically mentions these clauses to in 5.0 standard which was the reason to add 50.
Should we remove this string do is there some other place to change in TableGen?

kiranchandramohan added inline comments.
llvm/include/llvm/Frontend/OpenMP/OMP.td
476–477

I think in general for these situation we have chosen not to add the 5.0 version. Is that right @clementval?

But correcting these testcases is probably the right thing to do. But for that we might need some inputs from @jdoerfert or @Meinersbur.

clementval added inline comments.Jan 19 2021, 11:26 AM
llvm/include/llvm/Frontend/OpenMP/OMP.td
476–477

Flang is not using this information now but clang is using it. So if you introduce the version on those clauses and some clang/openmp tests are failing they should be investigated.

AMDChirag updated this revision to Diff 353379.Jun 21 2021, 8:09 AM
AMDChirag added a subscriber: AMDChirag.

Fixes the clang test cases

Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: cfe-commits. · View Herald Transcript

Hi @kiranchandramohan How do I restart the build? It says I don't have permission.

It could be because you are not the author. Can you commandeer the patch (option available in the Add Action menu below)?

AMDChirag commandeered this revision.Jun 22 2021, 1:13 AM
AMDChirag added a reviewer: sameeranjoshi.

It could be because you are not the author. Can you commandeer the patch (option available in the Add Action menu below)?

Just did that. Still the same error:

You do not have permission to edit this object.
Users with the "Can Edit" capability:
Administrators can take this action.
You must have edit permission on this build plan to pause, abort, resume, or restart it.You must have edit permission on this build plan to run it manually.

Can you rebase and update the patch? It seems to have built for the latest revision (Harbormaster completed remote builds in B110336: Diff 353548).

Oh great! That triggered it!
Thank you!

AMDChirag added a comment.EditedJun 22 2021, 2:32 AM

@kiranchandramohan It failed again. Apparently, it automatically attempted to add a patch D93105 which is already merged. I removed that patch as dependency before (edit related revisions), but it seems to have been added again.
Am I missing something?

https://buildkite.com/llvm-project/diff-checks/builds/49889#af4f049f-bb84-485c-8b30-9ca91ecc1bb9

@jdoerfert Could you please take a look at this patch as well? (especially for the clang part)

LGTM. Please update the commit message with information about changes in Clang tests as well.

This revision is now accepted and ready to land.Jul 19 2021, 9:09 AM
AMDChirag updated this revision to Diff 361597.Jul 26 2021, 1:58 AM

Rebase to current main branch

AMDChirag updated this revision to Diff 361598.Jul 26 2021, 2:01 AM

Removed parent line in summary, it was not longer relevant and caused build failures.

AMDChirag updated this revision to Diff 361605.Jul 26 2021, 2:59 AM

Minor test fix

AMDChirag updated this revision to Diff 362319.Jul 28 2021, 3:27 AM

Rebased. Verified, this patch is not causing any test failures for me.

AMDChirag updated this revision to Diff 363542.EditedAug 2 2021, 12:13 PM

Minor fix in test case; Rebased.

AMDChirag updated this revision to Diff 363624.Aug 2 2021, 9:56 PM
This comment was removed by AMDChirag.
AMDChirag updated this revision to Diff 363625.Aug 2 2021, 9:57 PM

updated commit message

This revision was landed with ongoing or failed builds.Aug 2 2021, 9:58 PM
This revision was automatically updated to reflect the committed changes.
AMDChirag edited the summary of this revision. (Show Details)Aug 2 2021, 9:59 PM