[flang-commits] [PATCH] D142197: [flang][hlfir] Enable allocate, deallocate, pointer assignment lowering

Jean Perier via Phabricator via flang-commits flang-commits at lists.llvm.org
Fri Jan 20 02:47:29 PST 2023


jeanPerier created this revision.
jeanPerier added reviewers: clementval, PeteSteinfeld.
jeanPerier added a project: Flang.
Herald added subscribers: sunshaoce, mehdi_amini, jdoerfert.
Herald added a project: All.
jeanPerier requested review of this revision.
Herald added a reviewer: jdoerfert.
Herald added a subscriber: sstefan1.

The previous patches allowed lowering allocatable/and pointer designator
expressions with HLFIR.
This patch updates the bridge genExprMutableBox to use HLFIR lowering
when HLFIR flag is set. For allocate and deallocate lowering that use
genExprMutableBox, no other change is needed.

For pointer assignments, the code doing the pointer assignments in the
bridge can be reused and is simply moved so that it can be shared, and
the "explicit context" special cases of the previous lowering are
by-passed.

The code doing pointer assignment revealed that convertExprToAddress
did not match the previous genExprAddr behavior (that actually
does not create temps for "x" where x is not contiguous).
Instead of trying to copy the old behavior that is a bit weird (was
dictated by the implementation rather than design). Update
convertExprToAddress to do something sensible and that works with
the current genExprAddr usages (if anything, it should saves bogus
array section temps).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D142197

Files:
  flang/include/flang/Lower/ConvertExprToHLFIR.h
  flang/lib/Lower/Allocatable.cpp
  flang/lib/Lower/Bridge.cpp
  flang/lib/Lower/ConvertCall.cpp
  flang/lib/Lower/ConvertExprToHLFIR.cpp
  flang/test/Lower/HLFIR/allocatable-and-pointer-status-change.f90

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D142197.490765.patch
Type: text/x-patch
Size: 35941 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230120/f9e72941/attachment-0001.bin>


More information about the flang-commits mailing list