forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Flang][OpenMP] Support teams reductions lowering (llvm#122683)
This patch adds PFT to MLIR lowering of teams reductions. Since there is still no MLIR to LLVM IR translation implemented, compilation of programs including these constructs will still trigger not-yet-implemented errors.
- Loading branch information
Showing
3 changed files
with
42 additions
and
21 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 was deleted.
Oops, something went wrong.
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,18 @@ | ||
! RUN: bbc -emit-hlfir -fopenmp -o - %s 2>&1 | FileCheck %s | ||
! RUN: %flang_fc1 -emit-hlfir -fopenmp -o - %s 2>&1 | FileCheck %s | ||
|
||
! CHECK: omp.declare_reduction @[[RED:.*]] : i32 init { | ||
|
||
! CHECK: func.func @_QPreduction_teams() { | ||
subroutine reduction_teams() | ||
integer :: i | ||
i = 0 | ||
|
||
! CHECK: omp.teams reduction(@[[RED]] %{{.*}}#0 -> %[[PRIV_I:.*]] : !fir.ref<i32>) { | ||
!$omp teams reduction(+:i) | ||
! CHECK: %[[DECL_I:.*]]:2 = hlfir.declare %[[PRIV_I]] | ||
! CHECK: %{{.*}} = fir.load %[[DECL_I]]#0 : !fir.ref<i32> | ||
! CHECK: hlfir.assign %{{.*}} to %[[DECL_I]]#0 : i32, !fir.ref<i32> | ||
i = i + 1 | ||
!$omp end teams | ||
end subroutine reduction_teams |