This is an archive of the discontinued LLVM Phabricator instance.

[flang][hlfir] get constant extents when possible
ClosedPublic

Authored by tblah on Apr 24 2023, 6:18 AM.

Details

Summary

If we know the extent at compile time, it is better to generate anarith.constant than hlfir.get_extent. This gives more information earlier in compilation (before hflir.get_extent is lowered).

Diff Detail

Event Timeline

tblah created this revision.Apr 24 2023, 6:18 AM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptApr 24 2023, 6:18 AM
Herald added a subscriber: mehdi_amini. · View Herald Transcript
tblah requested review of this revision.Apr 24 2023, 6:18 AM
tblah updated this revision to Diff 516383.Apr 24 2023, 6:21 AM

Remove extra lines in test

tblah retitled this revision from Summary: If we know the extent at compile time, it is better to generate an arith.constant. This gives more information earlier in compilation (before hflir.get_extent is lowered). to [flang][hlfir] get constant extents when possible.Apr 24 2023, 6:21 AM
tblah edited the summary of this revision. (Show Details)
jeanPerier accepted this revision.Apr 24 2023, 6:50 AM

LGTM, thanks

This revision is now accepted and ready to land.Apr 24 2023, 6:50 AM