[flang-commits] [flang] [mlir] [openmp] [Flang][OpenMP] Remove use of non reference values from MapInfoOp (PR #72444)
via flang-commits
flang-commits at lists.llvm.org
Thu Nov 16 00:29:26 PST 2023
https://github.com/jeanPerier requested changes to this pull request.
I did not look at the details of the lowering code, but from the patch description and looking at the tests, I am afraid that the new approach may be incorrect since it is re-evaluating the specification expressions inside the target region, but there is no guarantee that the specification expression will evaluate again to the same value once the execution part of a subprogram started.
For instance, in the following program, if you are reading n again at the point of the target directive to get a extent, the extent will not be correct.
```
subroutine omp_target_implicit_bounds(n)
integer :: n
integer :: a(n, 1024)
n = n + 1
!$omp target
a(11, 22) = 33
!$omp end target
end subroutine omp_target_implicit_bounds
```
So if you need to pass the extents/lengths by reference, you will need to make temporary from the SSA values and map that instead.
https://github.com/llvm/llvm-project/pull/72444
More information about the flang-commits
mailing list