Code generation to create and populate the descriptor (element size and
type code) is based on the boxed result type. This does not work well with
unlimited polymorphic entities since the fir type does not represent what is
actually emboxed or reboxed.
In the case of emboxing, the input type will be used to populate
the descriptor element size and type code.
When reboxing an unlimited polymorphic to a unlimited polymorphic entities, the
element size and type code is retrieve from the input box.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
All builds and tests correctly, and aside from a few nits, looks good to me. But I don't understand the code very well. @jeanPerier should take a look.
flang/lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
954 | Are we ready for this change? | |
flang/lib/Optimizer/CodeGen/CodeGen.cpp | ||
1559 | I assume that this should read "type has no type ..." | |
1583 | Should read "entity" rather than "entities". |
flang/lib/Frontend/CompilerInvocation.cpp | ||
---|---|---|
954 | No. Leftover from my tests. When we are ready the option will be removed completely. |
Looks great to me
flang/lib/Optimizer/CodeGen/CodeGen.cpp | ||
---|---|---|
1960 | Is loweredBox an mlir::Value here ? If so, I am a bit puzzled with the implicit conversion to mlir::Type. I would add a getType() just to make what is passed here clearer. |
flang/lib/Optimizer/CodeGen/CodeGen.cpp | ||
---|---|---|
1960 | Yes. There are now two functions for consDescriptorPrefix. One for XReboxOp and one for EmboxOp and XEmboxOp. The one for XReboxOp takes the loweredBox mlir::Value in so we can query the input descriptor. |
Are we ready for this change?