[Mlir-commits] [mlir] [mlir] [tensor] Add patterns to remove whole slicing of tensors (PR #107046)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Wed Sep 4 05:32:56 PDT 2024


Menooker wrote:

> Why isn't this just part of `tensor.insert_slice` folding?

Sorry. Do you mean it is already implemented, or we should move this pattern into fold() or canoncialize() of insert_slice?

I don’t implement this into fold/canoncialize because the bufferization is sensitive to the buffer positions (as is said by comments of populateMergeConsecutiveInsertExtractSlice. We are doing similar in this PR). There may be some cases when this pattern alters the bufferization result in an unexpected way of the user. So I bring this as an optional optimization pattern set.

https://github.com/llvm/llvm-project/pull/107046


More information about the Mlir-commits mailing list