[all-commits] [llvm/llvm-project] d05495: [flang] Fix shape analysis of RESHAPE result

Peter Klausler via All-commits all-commits at lists.llvm.org
Thu Apr 14 12:08:03 PDT 2022


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d054959786eeec6311218efd857c0cca658b6f77
      https://github.com/llvm/llvm-project/commit/d054959786eeec6311218efd857c0cca658b6f77
  Author: Peter Klausler <pklausler at nvidia.com>
  Date:   2022-04-14 (Thu, 14 Apr 2022)

  Changed paths:
    M flang/include/flang/Evaluate/shape.h
    M flang/lib/Evaluate/intrinsics.cpp
    M flang/lib/Evaluate/shape.cpp
    M flang/test/Semantics/call03.f90

  Log Message:
  -----------
  [flang] Fix shape analysis of RESHAPE result

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.

Differential Revision: https://reviews.llvm.org/D123712




More information about the All-commits mailing list