[mlir] Remove incorrect folding for SubTensorInsertOp
authorMaheshRavishankar <ravishankarm@google.com>
Wed, 3 Mar 2021 21:56:09 +0000 (13:56 -0800)
committerMaheshRavishankar <ravishankarm@google.com>
Wed, 3 Mar 2021 21:58:05 +0000 (13:58 -0800)
commitc118fdcd5970d66abf9cc3f0d09544b269b01cc8
tree50d93efc63c7258e5bb3add9321552cb9e9b24bc
parent75805dce5ff874676f3559c069fcd6737838f5c0
[mlir] Remove incorrect folding for SubTensorInsertOp

The SubTensorInsertOp has a requirement that dest type and result
type match. Just folding the tensor.cast operation violates this and
creates verification errors during canonicalization. Also fix other
canonicalization methods that werent inserting casts properly.

Differential Revision: https://reviews.llvm.org/D97800
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
mlir/lib/Dialect/StandardOps/IR/Ops.cpp
mlir/test/Dialect/Linalg/canonicalize.mlir