This is an archive of the discontinued LLVM Phabricator instance.

[flang][optimizer] support aggregate types inside tuple and record type
ClosedPublic

Authored by jeanPerier on Feb 1 2022, 5:56 AM.

Details

Summary

Allow fir.box type to be a member of a tuple<> or fir.type<>, in which
case it should be ensured it should be ensured the fir.box member is not
translate to the struct type of a Fortran runtime descriptor, and not a
pointer to it.

FIR type translation was also flattening nested tuple while lowering to LLVM
dialect types. There does not seem to be a deep reason for doing that
and doing it causes issues in fir.coordinate_of generated on such tuple
(a fir.coordinate_of getting tuple<B, C> in tuple<A, tuple<B, C>>
ended-up lowered to an LLVM GEP getting B).

Diff Detail

Event Timeline

jeanPerier created this revision.Feb 1 2022, 5:56 AM
jeanPerier requested review of this revision.Feb 1 2022, 5:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 1 2022, 5:56 AM
This revision is now accepted and ready to land.Feb 1 2022, 6:05 AM
schweitz accepted this revision.Feb 1 2022, 9:37 AM

Allow fir.box type to be a member of a tuple<> or fir.type<>, in which case it should be ensured it should be ensured the fir.box member is not translate to the struct type of a Fortran runtime descriptor, and not a pointer to it.

I don't understand this sentence.

Allow fir.box type to be a member of a tuple<> or fir.type<>, in which case it should be ensured it should be ensured the fir.box member is not translate to the struct type of a Fortran runtime descriptor, and not a pointer to it.

I don't understand this sentence.

I have rephrased it in the actual commit message.