This is an archive of the discontinued LLVM Phabricator instance.

[flang][hlfir] Enable allocate, deallocate, pointer assignment lowering
ClosedPublic

Authored by jeanPerier on Jan 20 2023, 2:47 AM.

Details

Summary

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).

Diff Detail

Event Timeline

jeanPerier created this revision.Jan 20 2023, 2:47 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 20 2023, 2:47 AM
jeanPerier requested review of this revision.Jan 20 2023, 2:47 AM
This revision is now accepted and ready to land.Jan 20 2023, 4:46 AM