Page MenuHomePhabricator

[OpenMP51] Initial support for masked directive and filter clause
ClosedPublic

Authored by cchen on Apr 6 2021, 3:19 PM.

Details

Summary

Adds basic parsing/sema/serialization support for the #pragma omp masked
directive.

Diff Detail

Event Timeline

cchen created this revision.Apr 6 2021, 3:19 PM
cchen requested review of this revision.Apr 6 2021, 3:19 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald Transcript
cchen updated this revision to Diff 335671.Apr 6 2021, 3:26 PM

Fix comments

marked->masked

clang/include/clang/AST/OpenMPClause.h
8244

condition?

8270–8272

Make it private

clang/lib/Parse/ParseOpenMP.cpp
2956–2958

Why you did not put it to the case with num_threads etc. clauses?

clang/lib/Sema/SemaOpenMP.cpp
4724–4728

Update a reference/text here

4758–4780

Sam, update text

clang/test/OpenMP/masked_ast_print.cpp
27

nonconst threadid tests?

cchen retitled this revision from [OpenMP51] Initial support for marked directive and filter clause to [OpenMP51] Initial support for masked directive and filter clause.Apr 7 2021, 9:02 AM
cchen updated this revision to Diff 335954.Apr 7 2021, 4:50 PM

Rebase and fix based on comments.

ABataev added inline comments.Apr 8 2021, 5:59 AM
clang/lib/Parse/ParseOpenMP.cpp
2814

This can be simplified like this:

    if (!FirstClause) {
      Diag(Tok, diag::err_omp_more_one_clause)
          << getOpenMPDirectiveName(DKind) << getOpenMPClauseName(CKind) << 0;
      ErrorFound = true;
    }
    LLVM_FALLTHROUGH;
case OMPC_filter:

Plus, I think, you should not exclude OMPC_filter from the check, I think only single clause is allowed by the spec.

cchen added inline comments.Apr 8 2021, 9:04 AM
clang/lib/Parse/ParseOpenMP.cpp
2814

I misunderstood the syntax and will fix this and the tests, thanks!

cchen updated this revision to Diff 336160.Apr 8 2021, 10:26 AM

Fix/Add test for "can not have more than one filter clause" issue and rebase.

This revision is now accepted and ready to land.Apr 8 2021, 10:28 AM
cchen updated this revision to Diff 336537.Apr 9 2021, 11:58 AM

Fix lit-test failure for dispatch_ast_print and rebase

This revision was landed with ongoing or failed builds.Apr 9 2021, 12:01 PM
This revision was automatically updated to reflect the committed changes.