[MLIR][Linalg] Fix propagation for rank-zero tensor
authorLorenzo Chelini <l.chelini@icloud.com>
Tue, 28 Feb 2023 14:31:18 +0000 (15:31 +0100)
committerLorenzo Chelini <l.chelini@icloud.com>
Wed, 1 Mar 2023 08:31:29 +0000 (09:31 +0100)
commit5885c85fc6a78a65dd9219e1921a307f7c963dd5
treeaff92fd339fec1511e129314e174e6a4c553be10
parentcb96eba27cd18ecf8041bf1b9a5c7e197f7a2749
[MLIR][Linalg] Fix propagation for rank-zero tensor

`isScalar` only returns true if the operand is non-shaped.
But we need to handle also rank zero tensors.

Reviewed By: hanchung

Differential Revision: https://reviews.llvm.org/D144989
mlir/lib/Dialect/Linalg/Transforms/DataLayoutPropagation.cpp
mlir/test/Dialect/Linalg/data-layout-propagation.mlir