-
Notifications
You must be signed in to change notification settings - Fork 13.9k
[OMPIRBuilder][OpenMP][LLVM] Modify and use ReplaceConstant utility in convertTarget #94541
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
agozillon
merged 5 commits into
llvm:main
from
agozillon:constant-to-instruction-expansion
Jun 13, 2024
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
476c9ba
[OMPIRBuilder][OpenMP][LLVM] Modify and use ReplaceConstant utility i…
agozillon f3ce7c0
restrict constant -> instruction upgrade to kernel/a specified function
agozillon e780783
Remove unnecessary brace initialization
agozillon 996b763
Revert no longer necessary alterations to MLIR test now that constant…
agozillon dc31b4f
Add comments to header describing new arguments
agozillon 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
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
51 changes: 51 additions & 0 deletions
51
offload/test/offloading/fortran/dtype-array-constant-index-map.f90
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,51 @@ | ||
! Offloading test which maps a specific element of a | ||
! derived type to the device and then accesses the | ||
! element alongside an individual element of an array | ||
! that the derived type contains. In particular, this | ||
! test helps to check that we can replace the constants | ||
! within the kernel with instructions and then replace | ||
! these instructions with the kernel parameters. | ||
! REQUIRES: flang | ||
! UNSUPPORTED: nvptx64-nvidia-cuda | ||
! UNSUPPORTED: nvptx64-nvidia-cuda-LTO | ||
! UNSUPPORTED: aarch64-unknown-linux-gnu | ||
! UNSUPPORTED: aarch64-unknown-linux-gnu-LTO | ||
! UNSUPPORTED: x86_64-pc-linux-gnu | ||
! UNSUPPORTED: x86_64-pc-linux-gnu-LTO | ||
|
||
! RUN: %libomptarget-compile-fortran-run-and-check-generic | ||
module test_0 | ||
type dtype | ||
integer elements(20) | ||
integer value | ||
end type dtype | ||
|
||
type (dtype) array_dtype(5) | ||
contains | ||
|
||
subroutine assign() | ||
implicit none | ||
!$omp target map(tofrom: array_dtype(5)) | ||
array_dtype(5)%elements(5) = 500 | ||
!$omp end target | ||
end subroutine | ||
|
||
subroutine add() | ||
implicit none | ||
|
||
!$omp target map(tofrom: array_dtype(5)) | ||
array_dtype(5)%elements(5) = array_dtype(5)%elements(5) + 500 | ||
!$omp end target | ||
end subroutine | ||
end module test_0 | ||
|
||
program main | ||
use test_0 | ||
|
||
call assign() | ||
call add() | ||
|
||
print *, array_dtype(5)%elements(5) | ||
end program | ||
|
||
! CHECK: 1000 |
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 descriptions of the new parameters to the function in the comment above.