[flang][hlfir] deref pointers before lowering assignment to hlfir.assign
authorJean Perier <jperier@nvidia.com>
Mon, 6 Feb 2023 14:14:08 +0000 (15:14 +0100)
committerJean Perier <jperier@nvidia.com>
Mon, 6 Feb 2023 14:14:22 +0000 (15:14 +0100)
commited8e858a1478d18d321f104a86a579e03ba1886e
tree156ff3217c5ceb3a1cd595b1c0d94f03940405ed
parentd041833f55d91321670f2ccfc22d66a85c279905
[flang][hlfir] deref pointers before lowering assignment to hlfir.assign

There is little point not to dereference pointers LHS and RHS before
before emitting an hlfir.assign when lowering an assignment.
This pushes complexity and descriptor read side effects that are better
expressed in a load before the assignment.

Differential Revision: https://reviews.llvm.org/D143372
flang/lib/Lower/Bridge.cpp
flang/lib/Optimizer/Builder/HLFIRTools.cpp
flang/test/Lower/HLFIR/allocatable-and-pointer-subparts.f90
flang/test/Lower/HLFIR/assignment-intrinsics.f90