[all-commits] [llvm/llvm-project] 2ef370: [flang][openmp] Update copyHostAssociateVar to use...
jeanPerier via All-commits
all-commits at lists.llvm.org
Fri Oct 20 02:12:06 PDT 2023
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 2ef370b7716b39390736e181d2eaabd740e1d59d
https://github.com/llvm/llvm-project/commit/2ef370b7716b39390736e181d2eaabd740e1d59d
Author: jeanPerier <jperier at nvidia.com>
Date: 2023-10-20 (Fri, 20 Oct 2023)
Changed paths:
M flang/include/flang/Optimizer/Builder/HLFIRTools.h
M flang/lib/Lower/Bridge.cpp
M flang/test/Lower/OpenMP/firstprivate-commonblock.f90
M flang/test/Lower/OpenMP/lastprivate-commonblock.f90
M flang/test/Lower/OpenMP/parallel-wsloop-firstpriv.f90
M flang/test/Lower/OpenMP/sections.f90
Log Message:
-----------
[flang][openmp] Update copyHostAssociateVar to use hlfir.assign for HLFIR (#69441)
The code in `copyHostAssociateVar` is using `createSomeArrayAssignment`
for arrays which is using the soon legacy expression lowering. Update
the copy to use hlfir.assign instead.
I used the temporary_lhs flag to mimic the current behavior, but maybe
user defined assignment should be called when needed .This flag also
prevents any finalizers to be called on the LHS if the LHS type has
finalizers (which would occur otherwise in normal intrinsic assignment).
Again, I am not sure what the OpenMP spec wants here.
Also, I added special handling for ALLOCATABLE, the current code seems
broken to me since it is basically copying the descriptor which would
lead to memory leak given the TEMP was previously allocated with the
shape of the variable in createHostAssociateVarClone. So copying the
DATA instead seemed like the right thing to do.
More information about the All-commits
mailing list