This is an archive of the discontinued LLVM Phabricator instance.

[flang] Lower elemental and transformational clean-up in HLFIR
ClosedPublic

Authored by jeanPerier on Jan 16 2023, 5:16 AM.

Details

Summary

In lowering to hlfir, no clean-up was added yet for
the created hlfir.elemental. Add the needed hlfir.destroy.

Regarding transformational lowering, clean-ups were created because
they are lowered in memory, but this is inconvenient because this
prevented lowering to hlfir from "moving" the created variable to
an expression. Add a new entry point in IntrinsicCall.h that keeps
track of whether or not the returned storage needs to be deallocated,
but does not insert the deallocation in the StatementContext.
This allows using the newly added hlfir.as_expr "move" aspect to be
used and save creating a copy.

Depends on D141839

Diff Detail

Event Timeline

jeanPerier created this revision.Jan 16 2023, 5:16 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 16 2023, 5:16 AM
jeanPerier requested review of this revision.Jan 16 2023, 5:16 AM
This revision is now accepted and ready to land.Jan 17 2023, 1:25 AM
This revision was landed with ongoing or failed builds.Jan 17 2023, 2:45 AM
This revision was automatically updated to reflect the committed changes.