This is an archive of the discontinued LLVM Phabricator instance.

[flang] Fix shape analysis of RESHAPE result
ClosedPublic

Authored by klausler on Apr 13 2022, 12:37 PM.

Details

Summary

Shape analysis of RESHAPE(..., SHAPE=s) should of course return
the SHAPE= actual argument when it is constant; but when it is
not, its length is still known, and thus so is the rank of the
result of RESHAPE(), and shape analysis should at least return
a shape vector of the right length rather than a result that
makes the result appear to be a scalar, which can lead to some
bogus error messages.

Also, while here: rename a private GetShapeHelper::AsShape()
routine so that it can't be confused with the ones in the API
of shape.h.

Diff Detail

Event Timeline

klausler created this revision.Apr 13 2022, 12:37 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2022, 12:37 PM
Herald added a subscriber: jdoerfert. · View Herald Transcript
klausler requested review of this revision.Apr 13 2022, 12:37 PM
This revision is now accepted and ready to land.Apr 14 2022, 3:29 AM
This revision was automatically updated to reflect the committed changes.