This is an archive of the discontinued LLVM Phabricator instance.

[flang] Inline array size call when dim is compile time constant
ClosedPublic

Authored by razvanlupusoru on May 11 2023, 10:44 AM.

Details

Summary

Instead of calling _FortranASizeDim, we can instead load extent
directly from descriptor. Add this support for cases where dim
is a known constant at compile time.

Diff Detail

Event Timeline

Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptMay 11 2023, 10:44 AM
razvanlupusoru requested review of this revision.May 11 2023, 10:44 AM
clementval added a comment.EditedMay 11 2023, 10:52 AM

Looks good. Can you just add a lit test for that in flang/test/Lower/Intrinsics/size.f90?

Added lit test. Previously this test was calling _FortranASizeDim but now loads from descriptor directly.

This revision is now accepted and ready to land.May 11 2023, 12:44 PM