[MLIR][Linalg] Handle Attribute in InitTensorOp
authorLorenzo Chelini <l.chelini@icloud.com>
Thu, 13 Jan 2022 07:43:29 +0000 (08:43 +0100)
committerLorenzo Chelini <l.chelini@icloud.com>
Mon, 17 Jan 2022 10:43:19 +0000 (11:43 +0100)
commitca2ac2bb14624257d9bc0a53919dbbc5f447c7fc
tree76e1cbfd3f99dfb899e4c8d2911cc041ff7f5b0e
parentab3f100bec03d72ecee947a323c51698d4b95207
[MLIR][Linalg] Handle Attribute in InitTensorOp

In some cases, the result of an initTensorOp may have an attribute.
However, the Attribute was not passed to `inferResultType`, failing the
verifier. Therefore, propagate the Attribute to `inferResultType`.

Reviewed By: ftynse

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