This is an archive of the discontinued LLVM Phabricator instance.

[fir] Add fir ragged array builder
ClosedPublic

Authored by clementval on Nov 24 2021, 6:50 AM.

Details

Summary

This patch introduces a bunch of builder functions
to create function calls to runtime ragged arrays functions.

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

Co-authored-by: Eric Schweitz <eschweitz@nvidia.com>

Diff Detail

Event Timeline

clementval created this revision.Nov 24 2021, 6:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 24 2021, 6:50 AM
clementval requested review of this revision.Nov 24 2021, 6:50 AM
Herald added a project: Restricted Project. · View Herald TranscriptNov 24 2021, 6:50 AM

Rebase on top of D114557

I have a couple of questions.

flang/lib/Optimizer/Builder/Runtime/Ragged.cpp
35

I guess this is two now, right?

flang/unittests/Optimizer/Builder/Runtime/RaggedTest.cpp
19

Nit: I guess this is not a true representation of a header.
But I guess it is OK since we are not testing the structure of the header.

Also, is the tupleTy/pair due to the previous representation of the raggedArrayHeader?

32

Nit: This seems to be different from the header creation above.

I guess a common getHeader function to get the header and a comment indicating that this is not a true header but just used for testing the call to the Ragged runtime functions might be helpful.

clementval updated this revision to Diff 392739.Dec 8 2021, 6:19 AM
clementval marked 3 inline comments as done.

Address review comments

flang/lib/Optimizer/Builder/Runtime/Ragged.cpp
35

Good catch. Updated and I added a comment for this magic number.

flang/unittests/Optimizer/Builder/Runtime/RaggedTest.cpp
19

There is actually a helper function in the FIRBuilder for that so I just bring it in with this patch.

This revision is now accepted and ready to land.Dec 8 2021, 6:22 AM
This revision was automatically updated to reflect the committed changes.