This is an archive of the discontinued LLVM Phabricator instance.

[Flang][NFC] Add test with shape for allocmem and freemem
ClosedPublic

Authored by kiranchandramohan on Dec 15 2021, 5:15 AM.

Diff Detail

Event Timeline

Herald added a project: Restricted Project. · View Herald TranscriptDec 15 2021, 5:15 AM
kiranchandramohan requested review of this revision.Dec 15 2021, 5:15 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 15 2021, 5:15 AM

Thank you @kiranchandramohan ! A few micro nits, otherwise LGTM!

flang/test/Fir/convert-to-llvm.fir
206

Could %arg0 and %arg1 be index instead? Wouldn't that make this test much simpler?

218

[nit] M is a bit enigmatic without the original source code. You could rename as N_ROWS (and N as N_COLS).

250

It might be LEN_SIZE rather than TOTAL_SIZE, not sure!

Minor changes to address review comments.
Pass the dimensions as arguments instead of loading them.
Use index types to avoid conversion.
trim the allocmem/free operations of attributes.

awarzynski accepted this revision.Dec 16 2021, 5:37 AM

Looks great, thank you!

This revision is now accepted and ready to land.Dec 16 2021, 5:37 AM
kiranchandramohan marked 3 inline comments as done.Dec 16 2021, 5:38 AM

Thanks @awarzynski. I have made the suggested changes.

flang/test/Fir/convert-to-llvm.fir
206

Yes, it will make it a simpler test. I have made the change.

The original intent was to add a test that would model the input coming from the lowering and add the fortran source corresponding to it.

218

Have changed to NROWS, NCOLS.

This revision was landed with ongoing or failed builds.Dec 16 2021, 5:49 AM
This revision was automatically updated to reflect the committed changes.
kiranchandramohan marked 2 inline comments as done.