This is an archive of the discontinued LLVM Phabricator instance.

[flang][docs] Add lowering design doc for parameterized derived-type
ClosedPublic

Authored by clementval on Sep 1 2022, 1:19 AM.

Details

Summary

This document aims to give insights at the representation of parameterized
derived-type (PDTs) in FIR and how PDTs are lowered to FIR and interact
with the runtime.

Diff Detail

Event Timeline

clementval created this revision.Sep 1 2022, 1:19 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptSep 1 2022, 1:19 AM
clementval requested review of this revision.Sep 1 2022, 1:19 AM
jeanPerier accepted this revision.Sep 1 2022, 2:03 AM

Thanks for writing all this down !

flang/docs/ParameterizedDerivedTypes.md
217

"to rely" -> "to not rely" ?

824

"will " -> "will be updated" ?

This revision is now accepted and ready to land.Sep 1 2022, 2:03 AM

Thanks, @clementval for this detailed Design Document. I did a quick read and have a few nit comments or questions.

flang/docs/ParameterizedDerivedTypes.md
24
109

Nit: The parameters are missing here.

125

Nit: The parameters are missing here.

153

Nit: parameters are missing here.

160

Nit: parameters are missing here.

674
687
824

Nit: Something is missing in this sentence.

825

In all the following operations could you clarify whether any operation is being extended to accomodate type parameters?

927

I understand that no change is proposed here but is the typeparams field required here give that both res and buffer have the parameters in their type?

932

Are any changes required for the ArrayValueCopy pass?

clementval updated this revision to Diff 457239.Sep 1 2022, 5:35 AM
clementval marked 13 inline comments as done.

Address review comments

flang/docs/ParameterizedDerivedTypes.md
825

The operation design is already accommodating type parameters. Lowering and codegen will need to use them accordingly.

927

the actual length parameters value is available only if the buffer or res is boxed since they are stored in the addendum.

932

Likely not in term of design but any part that is handling type parameter right now will need to be double check and adapted to the chosen solution and implementation.

klausler accepted this revision.Sep 1 2022, 10:31 AM
klausler added inline comments.
flang/docs/ParameterizedDerivedTypes.md
143

It turned out that the runtime had to traverse components anyway in order to perform byte-swapped unformatted I/O, so this part is already done now.