-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[flang][acc] Ensure fir.class is handled in type categorization #146174
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
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
module mm | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This test should probably go in There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh I just saw that you added another test like that in this folder as well. No strong opinion on this. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I prefer the test this way - changing FIR directly, especially for derived types - is not quite the nicest experience due to the verbosity. I hope you can be OK with this! |
||
type, public :: polyty | ||
real :: field | ||
end type | ||
contains | ||
subroutine init(this) | ||
class(polyty), intent(inout) :: this | ||
!$acc enter data copyin(this, this%field) | ||
Comment on lines
+9
to
+10
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Have you check if it works as well with an unlimited polymorphic dummy?
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It did not - and now I fixed it as I described below. |
||
end subroutine | ||
end module | ||
|
||
! RUN: bbc -fopenacc -emit-hlfir %s -o - | fir-opt -pass-pipeline='builtin.module(test-fir-openacc-interfaces)' --mlir-disable-threading 2>&1 | FileCheck %s | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Any reason to not add the run line at the top? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Fixed. It was on accident. |
||
! CHECK: Visiting: {{.*}} acc.copyin {{.*}} {name = "this", structured = false} | ||
! CHECK: Mappable: !fir.class<!fir.type<_QMmmTpolyty{field:f32}>> | ||
! CHECK: Type category: composite | ||
! CHECK: Visiting: {{.*}} acc.copyin {{.*}} {name = "this%field", structured = false} | ||
! CHECK: Pointer-like: !fir.ref<f32> | ||
! CHECK: Type category: composite |
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.
Should we make a distinction for unlimited polymorphic that can be smth else than a composite?
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. I am currently categorizing it as "uncategorized". Although the OpenACC spec does not discuss unlimited polymorphic or assumed type - the language semantics should apply. Namely, the type should be appropriately selected for the categorization to work.