-
Notifications
You must be signed in to change notification settings - Fork 13.1k
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
[Flang][OpenMP] Compilation error of combining select type construct and task construct with depend clause #132647
Comments
@llvm/issue-subscribers-flang-ir Author: None (ohno-fj)
```
Version of flang : 21.0.0(3e6f618)/AArch64
```
Combining
The following are the test program, Flang, Gfortran and ifx compilation/execution result. sngg362t_2.f90: program main
type ty
character(len=5)::i(3)
end type ty
type,extends(ty)::tt
integer(kind=2),allocatable::n(:)
end type tt
class(ty),allocatable::obj
allocate(tt::obj)
obj%i = "AAAAA"
select type (obj)
type is (tt)
allocate(obj%n(4))
obj%n = 10
associate(p2=>obj%n(1:4:2))
!$omp task depend(in:p2)
obj%n(1:4:2) = 11
!$omp end task
print *,'pass'
endassociate
class default
print*,"912"
end select
end program main
|
Thanks for reporting the issue. I am working on supporting array sections with task depend and will have to support task dependencies of type !fir.box<!fir.array< >> as part of that. |
The OpenMP standard says that all dependencies in the same set of inter-dependent tasks must be non-overlapping. This simplification means that the OpenMP only needs to keep track of the base addresses of dependency variables. This can be seen in kmp_taskdeps.cpp, which stores task dependency information in a hash table, using the base address as a key. This patch generates a rebox operation to slice boxed arrays, but only the box data address is used for the task dependency. The extra box is optimized away by LLVM at O3. Vector subscripts are TODO (I will address in my next patch). This also fixes a bug for ordinary subscripts when the symbol was mapped to a box: Fixes llvm#132647
Combining
select type construct
andtask construct
withdepend clause
results in a compilation error.Compilation ends normally in the following cases:
-fopenmp
)depend clause
The following are the test program, Flang, Gfortran and ifx compilation/execution result.
sngg362t_2.f90:
The text was updated successfully, but these errors were encountered: