[mlir][tensor][bufferize] Implement getBufferType for CastOp
authorMatthias Springer <springerm@google.com>
Wed, 1 Feb 2023 11:58:39 +0000 (12:58 +0100)
committerMatthias Springer <springerm@google.com>
Wed, 1 Feb 2023 13:24:10 +0000 (14:24 +0100)
commitb6ae3f88731c8a82668bd5a992a5ae9b41e716a9
treef54414d34f5e0ae148569b0d39ce836ad2cb477c
parent02562804d074a4d6e041e00572483fe25932186e
[mlir][tensor][bufferize] Implement getBufferType for CastOp

This interface method is used to compute the buffer type of a value during bufferization. It was missing. This is interface method is used during loop bufferization.

Also fix a bug where a cast from an unranked tensor to a ranked tensor type did not always apply a fully dynamic layout map on the result memref.

Differential Revision: https://reviews.llvm.org/D143063
mlir/lib/Dialect/Tensor/Transforms/BufferizableOpInterfaceImpl.cpp
mlir/test/Dialect/SCF/one-shot-bufferize.mlir
mlir/test/Dialect/Tensor/bufferize.mlir
mlir/test/Dialect/Tensor/one-shot-bufferize.mlir