[flang-commits] [flang] [Flang][OpenMP] Align map clause generation and fix issue with non-shared allocations for assumed shape/size descriptor types (PR #97855)
via flang-commits
flang-commits at lists.llvm.org
Tue Jul 9 00:58:38 PDT 2024
================
@@ -970,25 +970,21 @@ bool ClauseProcessor::processMap(
object.ref(), clauseLocation, asFortran, bounds,
treatIndexAsSection);
- auto origSymbol = converter.getSymbolAddress(*object.sym());
- mlir::Value symAddr = info.addr;
- if (origSymbol && fir::isTypeWithDescriptor(origSymbol.getType()))
- symAddr = origSymbol;
-
// Explicit map captures are captured ByRef by default,
// optimisation passes may alter this to ByCopy or other capture
// types to optimise
+ mlir::Value baseOp = info.rawInput;
----------------
jeanPerier wrote:
> However, this binding only extends for the scope of the target region and seems to not pose a problem when utilising the "raw" value as the map input. Would this be something you think would cause an issue (from testing so far, it doesn't appear to)?
As long as this new binding inside the OpenMP region happens by generating a new hlfir.declare with the non default lower bounds (also passed as block arguments?), then it is fine, even if the hlfir.declare input is the "raw" value (just like outside of the OpenMP region).
If you tested something like with n different from 1, you are fine:
```
subroutine omp_target_implicit_bounds(n, m)
integer(8) :: n,m
integer :: a(n:m)
!$omp target
a(11) = 22
!$omp end target
end subroutine omp_target_implicit_bounds
```
https://github.com/llvm/llvm-project/pull/97855
More information about the flang-commits
mailing list