[flang][hlfir] user defined assignment codegen
authorJean Perier <jperier@nvidia.com>
Mon, 26 Jun 2023 11:23:12 +0000 (13:23 +0200)
committerJean Perier <jperier@nvidia.com>
Mon, 26 Jun 2023 11:24:36 +0000 (13:24 +0200)
commit9231134708a40f25b3e43085f432470ded081cba
treea35f00a2b50f8d37251ba3ecc5e4f1960753fc7d
parent67169233322397e01cfdcdbf8131d77d38a41be0
[flang][hlfir] user defined assignment codegen

Add codegen support for hlfir.region_assign with user defined
assignment.

It is currently a bit pessimistic, because outside of forall, it
does not use the PURE aspect, if any, of the assignment routine to
rule out that the routine can write to something else than the LHS that
could overlap with the RHS.
However, the current lowering is anyway adding parenthesis around the
RHS, so this should not cause performance regressions.

Differential Revision: https://reviews.llvm.org/D153516
flang/lib/Optimizer/HLFIR/Transforms/LowerHLFIROrderedAssignments.cpp
flang/lib/Optimizer/HLFIR/Transforms/ScheduleOrderedAssignments.cpp
flang/test/HLFIR/order_assignments/user-defined-assignment.fir [new file with mode: 0644]