This is an archive of the discontinued LLVM Phabricator instance.

[flang] Replace !fir.ref<BoxType> -> BoxType conversion with a load prior to calling fir.dispatch
ClosedPublic

Authored by Renaud-K on Mar 15 2023, 6:29 PM.

Details

Summary

Converting a !fir.ref<BoxType> -> BoxType is sort of ok because all boxes are bufferized during codegen and replaced with a memory reference. Then CodeGen of fir.dispatch does the load. But as we are working on moving polymorphic transformation into the fir-polymorphic-op pass (https://reviews.llvm.org/D144921), the load needs to be made explicit so the lowering of fir.dispatch can be done in FIR instead of LLVM dialect.
I thought it would be better to make this change into its own patch in case it introduces issues.

Diff Detail

Event Timeline

Renaud-K created this revision.Mar 15 2023, 6:29 PM
Herald added a project: Restricted Project. · View Herald TranscriptMar 15 2023, 6:29 PM
Renaud-K requested review of this revision.Mar 15 2023, 6:29 PM

All builds and tests correctly, but I don't understand this code very well. Someone who does should approve.

clementval accepted this revision.Mar 16 2023, 1:00 AM

As you pointed out this is ok to do the conversion but I think it is looks better to do the load. Thanks for the patch Renaud! LGTM

This revision is now accepted and ready to land.Mar 16 2023, 1:00 AM

There is a failure on the pre commit CI but I doesn't look related to your change at all.

Driver/code-gen-rv64.f90

jeanPerier accepted this revision.Mar 17 2023, 1:16 AM
This revision was landed with ongoing or failed builds.Mar 17 2023, 1:14 PM
This revision was automatically updated to reflect the committed changes.