forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Flang][OpenMP] Accept the reduction modifier (llvm#86492)
Accept the reduction modifier in the Flang parser. Issue a TODO message during lowering. OpenMP 5.0 introduced the reduction modifier. Details can be seen in 2.19.5.4 reductionClause. OpenMP 5.2 relevant section is 5.5.8reductionClause. This will help remove some of the parser errors highlighted in the following post and also bring it to a well defined behaviour (produce TODO errors for unsupported features, do not crash). https://discourse.llvm.org/t/proposal-rename-flang-new-to-flang/69462/60
- Loading branch information
1 parent
1b310c4
commit 17cb8a5
Showing
10 changed files
with
75 additions
and
8 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
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,13 @@ | ||
! RUN: %not_todo_cmd bbc -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s | ||
! RUN: %not_todo_cmd %flang_fc1 -emit-fir -fopenmp -o - %s 2>&1 | FileCheck %s | ||
|
||
! CHECK: not yet implemented: Reduction modifiers are not supported | ||
|
||
subroutine foo() | ||
integer :: i, j | ||
j = 0 | ||
!$omp do reduction (inscan, *: j) | ||
do i = 1, 10 | ||
j = j + 1 | ||
end do | ||
end subroutine |
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,20 @@ | ||
! RUN: %flang_fc1 -fdebug-unparse-no-sema -fopenmp %s | FileCheck --ignore-case %s | ||
! RUN: %flang_fc1 -fdebug-dump-parse-tree-no-sema -fopenmp %s | FileCheck --check-prefix="PARSE-TREE" %s | ||
|
||
subroutine foo() | ||
integer :: i, j | ||
j = 0 | ||
! CHECK: !$OMP DO REDUCTION(TASK,*:j) | ||
! PARSE-TREE: | | ExecutionPartConstruct -> ExecutableConstruct -> OpenMPConstruct -> OpenMPLoopConstruct | ||
! PARSE-TREE: | | | OmpBeginLoopDirective | ||
! PARSE-TREE: | | | | OmpLoopDirective -> llvm::omp::Directive = do | ||
! PARSE-TREE: | | | | OmpClauseList -> OmpClause -> Reduction -> OmpReductionClause | ||
! PARSE-TREE: | | | | | ReductionModifier = Task | ||
! PARSE-TREE: | | | | | OmpReductionOperator -> DefinedOperator -> IntrinsicOperator = Multiply | ||
! PARSE-TREE: | | | | | OmpObjectList -> OmpObject -> Designator -> DataRef -> Name = 'j | ||
!$omp do reduction (task, *: j) | ||
do i = 1, 10 | ||
j = j + 1 | ||
end do | ||
!$omp end do | ||
end |
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