-
Notifications
You must be signed in to change notification settings - Fork 14.4k
[Flang][OMP]Add support for DECLARE MAPPER parsing and semantics #115160
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
Leporacanthicus
merged 7 commits into
llvm:main
from
Leporacanthicus:omp-declare-mapper
Nov 14, 2024
Merged
Changes from 1 commit
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
8bc59ff
[Flang][OMP]Add support for DECLARE MAPPER parsing and semantics
Leporacanthicus 66b0170
Review updates
Leporacanthicus 3d810ef
Move PushContext so mapper name is available in the outer context.
Leporacanthicus 98aca98
Update version in OMP.td
Leporacanthicus a5c72cc
Fix test and remove redundant check
Leporacanthicus 085454a
Add documentation for parsing
Leporacanthicus 3e563fd
Add further tests, fix comments
Leporacanthicus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev
Previous commit
Add further tests, fix comments
- Loading branch information
commit 3e563fdbe4d988908f0c52853b13d15665fbb893
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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,24 @@ | ||
! RUN: %flang_fc1 -fdebug-dump-symbols -fopenmp -fopenmp-version=50 %s | FileCheck %s | ||
|
||
program main | ||
!CHECK-LABEL: MainProgram scope: main | ||
implicit none | ||
|
||
type ty | ||
integer :: x | ||
end type ty | ||
!$omp declare mapper(mymapper : ty :: mapped) map(mapped, mapped%x) | ||
!$omp declare mapper(ty :: maptwo) map(maptwo, maptwo%x) | ||
|
||
!! Note, symbols come out in their respective scope, but not in declaration order. | ||
!CHECK: default: Misc ConstructName | ||
!CHECK: mymapper: Misc ConstructName | ||
!CHECK: ty: DerivedType components: x | ||
!CHECK: DerivedType scope: ty | ||
!CHECK: OtherConstruct scope: | ||
!CHECK: mapped (OmpMapToFrom) {{.*}} ObjectEntity type: TYPE(ty) | ||
!CHECK: OtherConstruct scope: | ||
!CHECK: maptwo (OmpMapToFrom) {{.*}} ObjectEntity type: TYPE(ty) | ||
|
||
end program main | ||
|
This file contains hidden or 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 hidden or 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 hidden or 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,16 @@ | ||
! RUN: %python %S/../test_errors.py %s %flang -fopenmp -fopenmp-version=50 | ||
! Test the declare mapper construct with two default mappers. | ||
|
||
type :: t1 | ||
integer :: y | ||
end type t1 | ||
|
||
type :: t2 | ||
real :: y, z | ||
end type t2 | ||
|
||
!error: 'default' is already declared in this scoping unit | ||
|
||
!$omp declare mapper(t1::x) map(x, x%y) | ||
!$omp declare mapper(t2::w) map(w, w%y, w%z) | ||
end |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a few comments saying what this function is doing and why everything is done in Pre?
The change here requires a debug-dump-symbols or an unparse with symbols test.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see a debug-dump-symbols test (
%flang_fc1 -fopenmp -fdebug-dump-symbols -o - %s 2>&1 | FileCheck %s
) or an unparse with symbols test (! RUN: %python %S/../test_symbols.py %s %flang_fc1 -fopenmp
).