[mlir][tensor] InsertSliceOp verification.
authorNicolas Vasilache <nicolas.vasilache@gmail.com>
Mon, 29 Nov 2021 16:22:45 +0000 (16:22 +0000)
committerNicolas Vasilache <nicolas.vasilache@gmail.com>
Tue, 30 Nov 2021 20:37:06 +0000 (20:37 +0000)
commita08b750ce9df2bf1cf9270d83c50de68eeb8b6f5
treea1d40762940266d92f9c82a3c846cac08dbfbc84
parent311dd55c9eb9342b1c889f6db7728f15b05378bb
[mlir][tensor] InsertSliceOp verification.

This revision reintroduces tensor.insert_slice verification which seems
to have vanished over time: a verifier was initially introduced in cf9503c1b752062d9abfb2c7922a50574d9c5de4
but for some reason the invalid.mlir was not properly updated; as time passed the verifier was not called anymore and later the code was deleted.

As a consequence, a non-negligible portion of tests has run astray using invalid
tensor.insert_slice semantics and needed to be fixed.

Also, extract isRankReducedType from TensorOps for better reuse
Originally, this facility was used by both tensor and memref forms but
it got copied around as dialects were split.

Differential Revision: https://reviews.llvm.org/D114715
18 files changed:
mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td
mlir/include/mlir/Dialect/Utils/StaticValueUtils.h
mlir/include/mlir/IR/BuiltinTypes.h
mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
mlir/lib/Dialect/Tensor/IR/TensorOps.cpp
mlir/lib/Dialect/Utils/StaticValueUtils.cpp
mlir/lib/IR/BuiltinTypes.cpp
mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir
mlir/test/Dialect/Linalg/comprehensive-module-bufferize-analysis.mlir
mlir/test/Dialect/Linalg/roundtrip.mlir
mlir/test/Dialect/MemRef/invalid.mlir
mlir/test/Dialect/SCF/for-loop-canonicalization.mlir
mlir/test/Dialect/Tensor/canonicalize.mlir
mlir/test/Dialect/Tensor/invalid.mlir
mlir/test/Dialect/Tensor/ops.mlir
mlir/test/IR/core-ops.mlir