This is an archive of the discontinued LLVM Phabricator instance.

[DebugInfo] Upgrade DISubragne::count to accept DIExpression also
ClosedPublic

Authored by alok on Mar 25 2021, 6:25 AM.

Details

Summary

This is needed for Fortran assumed shape arrays whose dimensions are defined as,

  • 'count' is taken from array descriptor passed as parameter by caller, access from descriptor is defined by type DIExpression.
  • 'lowerBound' is defined by callee.

The current alternate way represents using upperBound in place of count, where

  • where upperBound is calculated in callee in a temp variable using lowerBound and count

Representation with count (DIExpression) is not only clearer as compared to upperBound (DIVariable) but it has another
advantage that variable count is accessed by being parameter has better chance of survival at higher optimization level than upperBound being local variable.

Diff Detail

Event Timeline

alok created this revision.Mar 25 2021, 6:25 AM
alok requested review of this revision.Mar 25 2021, 6:25 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 25 2021, 6:25 AM
aprantl accepted this revision.Mar 29 2021, 6:07 PM

Thanks, I think this makes sense!

This revision is now accepted and ready to land.Mar 29 2021, 6:07 PM
alok added a comment.Mar 29 2021, 9:28 PM

Thanks, I think this makes sense!

Thanks a lot @aprantl .