[all-commits] [llvm/llvm-project] 91bd4c: [flang] Preserve useResultSymbolShape_ option when...

jeanPerier via All-commits all-commits at lists.llvm.org
Fri Feb 24 00:07:02 PST 2023

  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 91bd4c6e81ac8aebf1089eb52b935484925f2f58
  Author: Jean Perier <jperier at nvidia.com>
  Date:   2023-02-24 (Fri, 24 Feb 2023)

  Changed paths:
    M flang/include/flang/Evaluate/shape.h
    M flang/test/Evaluate/rewrite01.f90

  Log Message:
  [flang] Preserve useResultSymbolShape_ option when folding array constructor shape

By default evaluate::GetShape(expr) may return a compiler generated expression
using symbols that are part of function interfaces if there are function
references in "expr".
It is not right to replace an inquiry of "expr" with such compiler
generated expression since the call context would be lost, along with
the meaning of the inquiry expression.
Inquiry folding uses GetContextFreeShape(expr) that sets-up
useResultSymbolShape_ in GetShapeHelper to prevent such bad rewrites. But this did not
work properly with array constructor: GetShapeHelper made a call to
GetShape, ignoring and losing the "useResultSymbolShape_" instruction.

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

More information about the All-commits mailing list