[MLIR] Don't remove memref allocation if stored into another allocation
authorWilliam S. Moses <gh@wsmoses.com>
Fri, 25 Jun 2021 20:16:23 +0000 (16:16 -0400)
committerWilliam S. Moses <gh@wsmoses.com>
Mon, 28 Jun 2021 16:05:59 +0000 (12:05 -0400)
commitcccc7e5aa8088b3b721e1f430c47d199575fae9b
tree3e296d01a30200c0c40ddea456490a74f42cf703
parent75cacc6775ad8fc3d89c89ff77fc4a3b7de32111
[MLIR] Don't remove memref allocation if stored into another allocation

A canonicalization accidentally will remove a memref allocation if it is only stored into. However, this is incorrect if the allocation is the value being stored, not the allocation being stored into.

Differential Revision: https://reviews.llvm.org/D104947
mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
mlir/test/Dialect/MemRef/canonicalize.mlir