-
Notifications
You must be signed in to change notification settings - Fork 10.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Flang][OpenMP] : Add a temporary lowering for workshare directive (#…
…78268) As a temporary solution, lower workshare to the single directive
- Loading branch information
1 parent
0709eeb
commit b585c43
Showing
2 changed files
with
49 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
|
||
!RUN: %flang_fc1 -emit-hlfir -fopenmp %s -o - | FileCheck %s | ||
|
||
!CHECK-LABEL: func @_QPsb1 | ||
subroutine sb1(arr) | ||
integer :: arr(:) | ||
!CHECK: omp.parallel { | ||
!$omp parallel | ||
!CHECK: omp.single { | ||
!$omp workshare | ||
arr = 0 | ||
!$omp end workshare | ||
!CHECK: } | ||
!$omp end parallel | ||
!CHECK: } | ||
end subroutine | ||
|
||
!CHECK-LABEL: func @_QPsb2 | ||
subroutine sb2(arr) | ||
integer :: arr(:) | ||
!CHECK: omp.parallel { | ||
!$omp parallel | ||
!CHECK: omp.single nowait { | ||
!$omp workshare | ||
arr = 0 | ||
!$omp end workshare nowait | ||
!CHECK: } | ||
!$omp end parallel | ||
!CHECK: } | ||
end subroutine | ||
|
||
!CHECK-LABEL: func @_QPsb3 | ||
subroutine sb3(arr) | ||
integer :: arr(:) | ||
!CHECK: omp.parallel { | ||
!CHECK: omp.single { | ||
!$omp parallel workshare | ||
arr = 0 | ||
!$omp end parallel workshare | ||
!CHECK: } | ||
!CHECK: } | ||
end subroutine |