This is an archive of the discontinued LLVM Phabricator instance.

[fir] Add fir.box type conversion
ClosedPublic

Authored by clementval on Nov 5 2021, 8:22 AM.

Details

Summary

This patch add the !fir.box type conversion to llvm.
fir.box is converted to the descriptor as defined in the ISO_Fortran_binding.h
and the addendum defined in descriptor.h.

This patch is part of the upstreaming effort from fir-dev branch.

Co-authored-by: Jean Perier <jperier@nvidia.com>
Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>
Co-authored-by: V Donaldson <vdonaldson@nvidia.com>

Diff Detail

Event Timeline

clementval created this revision.Nov 5 2021, 8:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 5 2021, 8:22 AM
Herald added a subscriber: mehdi_amini. · View Herald Transcript
clementval requested review of this revision.Nov 5 2021, 8:22 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 5 2021, 8:22 AM
awarzynski added inline comments.Nov 5 2021, 12:51 PM
flang/lib/Optimizer/CodeGen/TypeConverter.h
75
78

Looking at https://github.com/llvm/llvm-project/blob/main/flang/include/flang/ISO_Fortran_binding.h#L125-L139, I think that this is incorrect/out-of-date. My suggestion is based on the current implementation in ISO_Fortran_binding.h.

79

or boxTypeParts or anything a bit more descriptive, pls

96

IIUC, everything that follows L96 sets up [dims], right? Definitely worth adding a comment.

flang/test/Fir/types-to-llvm.fir
37

Same suggestion for CHECK-LABEL/CHECK-SAME as in https://reviews.llvm.org/D113283

40

IIUC, we won't be able to check the actual type of i{{.*}} until https://bugs.llvm.org/show_bug.cgi?id=52418 is resolved. Could you add a comment?

clementval updated this revision to Diff 385449.Nov 8 2021, 4:17 AM
clementval marked 5 inline comments as done.

Address review comments

clementval marked an inline comment as done.Nov 8 2021, 4:17 AM
clementval added inline comments.
flang/test/Fir/types-to-llvm.fir
40

These tests are meant to be target agnostic in this form. We will probably add new check lines with specific prefix when we will check these types.

awarzynski accepted this revision.EditedNov 8 2021, 4:43 AM

LGTM, thank you for addressing my comments!

This revision is now accepted and ready to land.Nov 8 2021, 4:43 AM
This revision was automatically updated to reflect the committed changes.
clementval marked an inline comment as done.