[mlir][Linalg] Allow reshapes to collapse to a zero-rank tensor.
authorMaheshRavishankar <ravishankarm@google.com>
Wed, 13 May 2020 05:50:35 +0000 (22:50 -0700)
committerMaheshRavishankar <ravishankarm@google.com>
Wed, 13 May 2020 06:03:25 +0000 (23:03 -0700)
commitd2a9569850166083638a8fb88f7dae1c1b62a926
treec77feed1f7925f2ef5eb72daa63c79b39a43d4e2
parent782a4dd1a478e41857744b483b104b5e66857fbf
[mlir][Linalg] Allow reshapes to collapse to a zero-rank tensor.

This is only valid if the source tensors (result tensor) is static
shaped with all unit-extents when the reshape is collapsing
(expanding) dimensions.

Differential Revision: https://reviews.llvm.org/D79764
mlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
mlir/test/Dialect/Linalg/llvm.mlir
mlir/test/Dialect/Linalg/roundtrip.mlir