[mlir] Add translation from tensor.reshape to memref.reshape
authorAshay Rane <ashay@users.noreply.github.com>
Mon, 9 May 2022 15:41:21 +0000 (17:41 +0200)
committerMatthias Springer <springerm@google.com>
Mon, 9 May 2022 15:45:07 +0000 (17:45 +0200)
commite287d647c61f5fbd054410d6ed9c37d5271f29ef
treeaa9433a84c97edcb1b16d4b34f1beac5101d7739
parent8abfa5119addc97e881025a819b8d643d53dda14
[mlir] Add translation from tensor.reshape to memref.reshape

This patch augments the `tensor-bufferize` pass by adding a conversion
rule to translate ReshapeOp from the `tensor` dialect to the `memref`
dialect, in addition to adding a unit test to validate the translation.

Reviewed By: springerm

Differential Revision: https://reviews.llvm.org/D125031
mlir/lib/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.cpp
mlir/test/Dialect/Tensor/bufferize.mlir