This is an archive of the discontinued LLVM Phabricator instance.

[OpenMP] support depend clause for taskwait directive
ClosedPublic

Authored by dreachem on Nov 9 2021, 8:47 PM.

Details

Summary

This patch adds clang (parsing, sema, serialization, codegen) support for the 'depend' clause on the 'taskwait' directive.

Diff Detail

Event Timeline

dreachem created this revision.Nov 9 2021, 8:47 PM
dreachem requested review of this revision.Nov 9 2021, 8:47 PM
ABataev added inline comments.Nov 10 2021, 5:09 AM
clang/include/clang/AST/StmtOpenMP.h
2573–2582

Need to add descriptions for the new parameters

clang/lib/AST/StmtOpenMP.cpp
746–749

Just return createDirective<OMPTaskwaitDirective>(C, Clauses, /*AssociatedStmt=*/nullptr, /*NumChildren=*/0, StartLoc, EndLoc);

clang/lib/CodeGen/CGOpenMPRuntime.cpp
6274

Need to fix this one too

dreachem added inline comments.Nov 10 2021, 12:45 PM
clang/lib/CodeGen/CGOpenMPRuntime.cpp
6274

How would you recommend this case should be handled? Is it acceptable to change the if-condition to CGF.CGM.getLangOpts().OpenMPIRBuilder && Data.Dependences.empty()?

ABataev added inline comments.Nov 10 2021, 1:24 PM
clang/lib/CodeGen/CGOpenMPRuntime.cpp
6274

I just mean that need to implement support for this extended taskwait in OMPBuilder too.

dreachem added inline comments.Nov 10 2021, 1:58 PM
clang/lib/CodeGen/CGOpenMPRuntime.cpp
6274

Is that something you think needs to be implemented in this patch? Is there a general policy that new OpenMP features implemented in clang codegen must also be implemented in the IRBuilder? I ask, because there doesn't appear to be any support for explicit tasks or task dependences in the IRBuilder currently.

ABataev added inline comments.Nov 10 2021, 1:59 PM
clang/lib/CodeGen/CGOpenMPRuntime.cpp
6274

Not necessarily, just saying that need not forget to implement it. Worth adding TODO:

dreachem updated this revision to Diff 386345.Nov 10 2021, 4:14 PM

Updated comments, added TODO for handing extended taskwait directive in the OpenMPIRBuilder, and added semantic check that 'mutexinoutset' should not be specified in the 'depend' clause on 'taskwait'.

dreachem marked 3 inline comments as done.Nov 10 2021, 4:15 PM

I think I've addressed the first set of comments. I added a TODO comment for the OMP IRBuilder (HPE has not implemented this). I also added a diagnostic error message for the case of a mutexinoutset being specified in a depend clause on the taskwait directive, as this is specifically disallowed. Can reviewers take another look and let me know if this looks ready?

This revision is now accepted and ready to land.Nov 18 2021, 9:02 AM

I don't have commit access. Can someone commit this for me? Thanks.

I don't have commit access. Can someone commit this for me? Thanks.

Will do.

This revision was landed with ongoing or failed builds.Nov 19 2021, 6:31 AM
This revision was automatically updated to reflect the committed changes.
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 19 2021, 6:31 AM