Add tensor.insert op to make tensor.extract/tensor.insert work in pairs
for scalar domain. Like subtensor/subtensor_insert work in pairs in
tensor domain, and vector.transfer_read/vector.transfer_write work in
pairs in vector domain.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td | ||
---|---|---|
212 | Could the syntax tensor.insert %ut into %dest[%1, %2] : tensor<*xi32>work as well? The scalar type being inserted should always be the tensor element type (I think TypesMatchWith is able to support this) | |
227 | nit: why is cast to ShapedType needed? | |
mlir/lib/Dialect/Tensor/IR/TensorOps.cpp | ||
299 | Redundant after you add TypesMatchWith for scalar. |
address comments
mlir/include/mlir/Dialect/Tensor/IR/TensorOps.td | ||
---|---|---|
212 | Yes, it works. I also added the case to ops.mlir. It won't complain after adding TypesMatchWith. | |
227 | Done. It is not needed. I copied it from ExtractOp, but did not notice it. | |
mlir/lib/Dialect/Tensor/IR/TensorOps.cpp | ||
299 | Done, deleted. |
Could the syntax tensor.insert %ut into %dest[%1, %2] : tensor<*xi32>work as well? The scalar type being inserted should always be the tensor element type (I think TypesMatchWith is able to support this)