This is an archive of the discontinued LLVM Phabricator instance.

[flang][hlfir] Add hlfir.destroy operation.
ClosedPublic

Authored by jeanPerier on Jan 16 2023, 4:10 AM.

Details

Summary

Add the operation to mark the end of life of hlfir.expr.
As described in its description this is the easiest solution
to deploy given lowering "knows" where expression value are last
used.
However, inserting these points in lowering will probably make
it harder to do some IR transformation that would move the code
using or creating hlfir.expr (no use should be moved after an
hlfir.destroy).
Once the dust settle with the HLFIR change, it will be worth assessing
the situation and see if an analysis could do a better and safer job at
finding those destruction points.

Depends on D141832

Diff Detail

Event Timeline

jeanPerier created this revision.Jan 16 2023, 4:10 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJan 16 2023, 4:10 AM
jeanPerier requested review of this revision.Jan 16 2023, 4:10 AM
clementval accepted this revision.Jan 16 2023, 5:53 AM

LG other than small nits.

flang/include/flang/Optimizer/HLFIR/HLFIROps.td
507

There might be a word missing here or one that should not be here but the sentence is a bit weird to read.

508
flang/test/HLFIR/destroy-codegen.fir
2
This revision is now accepted and ready to land.Jan 16 2023, 5:53 AM
This revision was landed with ongoing or failed builds.Jan 17 2023, 2:28 AM
This revision was automatically updated to reflect the committed changes.