[flang] convert stack arrays allocation to match old type
authorTom Eccles <tom.eccles@arm.com>
Thu, 1 Jun 2023 19:23:25 +0000 (19:23 +0000)
committerTom Eccles <tom.eccles@arm.com>
Mon, 5 Jun 2023 09:57:57 +0000 (09:57 +0000)
commit775de6754af8d5122f10204097f41be02c5c9f3b
tree14dc8a1475d5493d76bd46387e45ebd22c2c7dc8
parent70bd66070944dbc09139e20913bd3f1510703c22
[flang] convert stack arrays allocation to match old type

The old fir.allocmem operation returned a !fir.heap<.> type. The new
fir.alloca operation returns a !fir.ref<.> type. This patch inserts a
fir.convert so that the old type is preserved. This prevents verifier
failures when types returned from fir.if statements don't match the
expected type.

Differential Revision: https://reviews.llvm.org/D151921
flang/lib/Optimizer/Transforms/StackArrays.cpp
flang/test/Transforms/stack-arrays.fir