[mlir] Fix folding into tensor.pad op.
authorAlexander Belyaev <pifon@google.com>
Thu, 30 Mar 2023 09:26:09 +0000 (11:26 +0200)
committerAlexander Belyaev <pifon@google.com>
Thu, 30 Mar 2023 09:30:06 +0000 (11:30 +0200)
commit76ea62a2735a760545bfa98524e7a658a15268ac
tree80e6172d6f6b2f764907be881b9c2562e3ceed7f
parent5213834f4ca687f10ac7f6df4a28334ddd85aea5
[mlir] Fix folding into tensor.pad op.

When low/high padding is folded in padOp, there should be inserted a
tensor.cast back to the original result type. Right now, there is a no-op
tensor.cast from new type to new type...

Differential Revision: https://reviews.llvm.org/D147210
mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
mlir/test/Dialect/Tensor/canonicalize.mlir