-
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] Improve support for
if
clause on combined constructs
This patch adds support for matching multiple OpenMP `if` clauses to their specified directive in a combined construct. It also enables this clause to be attached by name to `simd` and `teams` directives, in addition to the others that were already supported. This patch on its own cannot yet be tested because there is currently no lowering to MLIR support for any combined construct containing two or more OpenMP directives that can have an `if` clause attached. Depends on D155981. Differential Revision: https://reviews.llvm.org/D156313
- Loading branch information
Showing
9 changed files
with
885 additions
and
49 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
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
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,61 @@ | ||
! RUN: %flang_fc1 -fdebug-unparse-no-sema -fopenmp %s | FileCheck %s | ||
! Check Unparsing of OpenMP IF clause | ||
|
||
program if_unparse | ||
logical :: cond | ||
integer :: i | ||
|
||
! CHECK: !$OMP TARGET UPDATE | ||
! CHECK-SAME: IF(cond) | ||
!$omp target update if(cond) | ||
|
||
! CHECK: !$OMP TARGET UPDATE | ||
! CHECK-SAME: IF(TARGETUPDATE:cond) | ||
!$omp target update if(target update: cond) | ||
|
||
! CHECK: !$OMP TARGET UPDATE | ||
! CHECK-SAME: IF(TARGETUPDATE:cond) | ||
!$omp target update if(targetupdate: cond) | ||
|
||
! CHECK: !$OMP TARGET ENTER DATA | ||
! CHECK-SAME: IF(TARGETENTERDATA:cond) | ||
!$omp target enter data map(to: i) if(target enter data: cond) | ||
|
||
! CHECK: !$OMP TARGET EXIT DATA | ||
! CHECK-SAME: IF(TARGETEXITDATA:cond) | ||
!$omp target exit data map(from: i) if(target exit data: cond) | ||
|
||
! CHECK: !$OMP TARGET DATA | ||
! CHECK-SAME: IF(TARGETDATA:cond) | ||
!$omp target data map(tofrom: i) if(target data: cond) | ||
!$omp end target data | ||
|
||
! CHECK: !$OMP TARGET | ||
! CHECK-SAME: IF(TARGET:cond) | ||
!$omp target if(target: cond) | ||
!$omp end target | ||
|
||
! CHECK: !$OMP TEAMS | ||
! CHECK-SAME: IF(TEAMS:cond) | ||
!$omp teams if(teams: cond) | ||
!$omp end teams | ||
|
||
! CHECK: !$OMP PARALLEL DO SIMD | ||
! CHECK-SAME: IF(PARALLEL:i<10) IF(SIMD:.FALSE.) | ||
!$omp parallel do simd if(parallel: i < 10) if(simd: .false.) | ||
do i = 1, 10 | ||
end do | ||
!$omp end parallel do simd | ||
|
||
! CHECK: !$OMP TASK | ||
! CHECK-SAME: IF(TASK:cond) | ||
!$omp task if(task: cond) | ||
!$omp end task | ||
|
||
! CHECK: !$OMP TASKLOOP | ||
! CHECK-SAME: IF(TASKLOOP:cond) | ||
!$omp taskloop if(taskloop: cond) | ||
do i = 1, 10 | ||
end do | ||
!$omp end taskloop | ||
end program if_unparse |
Oops, something went wrong.