This is an archive of the discontinued LLVM Phabricator instance.

[flang] Allow conversion from hlfir.expr to fir::ExtendedValue
ClosedPublic

Authored by jeanPerier on Dec 5 2022, 7:27 AM.

Details

Summary

For now at least, the plan is to keep hlfir.expr usage limited as
sub-expression operand, assignment rhs, and a few other contexts (
e.g. Associate statements). The rest of lowering (statements lowering
in the bridge) will still expect to get and manipulate characters and
arrays in memory. That means that hlfir.expr must be converted to
variable in converter.genExprAddr/converter.genExprBox.

This is done using an hlfir.associate, and generating the related
hlfir.end_associate in the statement context.

hlfir::getFirBase of is updated to avoid bringing in the HLFIR
fir.boxchar/fir.box into FIR when the entity was created with
hlfir::AssociateOp.

Diff Detail

Event Timeline

jeanPerier created this revision.Dec 5 2022, 7:27 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 5 2022, 7:27 AM
jeanPerier requested review of this revision.Dec 5 2022, 7:27 AM
PeteSteinfeld accepted this revision.Dec 5 2022, 8:13 AM

All builds and tests correctly and looks good.

This revision is now accepted and ready to land.Dec 5 2022, 8:13 AM

Remove extra "!".