Skip to content

[LLVM][OpenMP] Add "nowait" clause as valid for "workshare" #88426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions flang/lib/Semantics/check-omp-structure.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ static const OmpDirectiveSet noWaitClauseNotAllowedSet{
Directive::OMPD_do_simd,
Directive::OMPD_sections,
Directive::OMPD_single,
Directive::OMPD_workshare,
};
} // namespace omp
} // namespace llvm
Expand Down
3 changes: 3 additions & 0 deletions flang/test/Semantics/OpenMP/clause-validity01.f90
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,9 @@
a = 1.0
!ERROR: COPYPRIVATE clause is not allowed on the END WORKSHARE directive
!$omp end workshare nowait copyprivate(a)
!$omp workshare nowait
!ERROR: NOWAIT clause is not allowed on the WORKSHARE directive, use it on OMP END WORKSHARE directive
!$omp end workshare
!$omp end parallel

! 2.8.1 simd-clause -> safelen-clause |
Expand Down
3 changes: 3 additions & 0 deletions llvm/include/llvm/Frontend/OpenMP/OMP.td
Original file line number Diff line number Diff line change
Expand Up @@ -2115,6 +2115,9 @@ def OMP_scope : Directive<"scope"> {
let association = AS_Block;
}
def OMP_Workshare : Directive<"workshare"> {
let allowedOnceClauses = [
VersionedClause<OMPC_NoWait>
];
let association = AS_Block;
}
def OMP_ParallelWorkshare : Directive<"parallel workshare"> {
Expand Down
Loading