[mlir] Fix SubTensorInsertOp semantics
authorNicolas Vasilache <nicolas.vasilache@gmail.com>
Wed, 20 Jan 2021 19:54:02 +0000 (19:54 +0000)
committerNicolas Vasilache <nicolas.vasilache@gmail.com>
Wed, 20 Jan 2021 20:16:01 +0000 (20:16 +0000)
commit866cb26039043581d5ab8b30d5a999a7c273f361
tree87f0afdb46e27ac071426fad3c960101c5b5b6f8
parent1c6d1e57c15b59114a05b20e667517872510aaa9
[mlir] Fix SubTensorInsertOp semantics

Like SubView, SubTensor/SubTensorInsertOp are allowed to have rank-reducing/expanding semantics. In the case of SubTensorInsertOp , the rank of offsets/sizes/strides should be the rank of the destination tensor.

Also, add a builder flavor for SubTensorOp to return a rank-reduced tensor.

Differential Revision: https://reviews.llvm.org/D95076
mlir/include/mlir/Dialect/StandardOps/IR/Ops.td
mlir/lib/Dialect/StandardOps/IR/Ops.cpp
mlir/test/IR/core-ops.mlir