[mlir][linalg] Fix crash in canonicalization pattern
authorMatthias Springer <springerm@google.com>
Wed, 2 Nov 2022 11:36:54 +0000 (12:36 +0100)
committerMatthias Springer <springerm@google.com>
Wed, 2 Nov 2022 13:05:48 +0000 (14:05 +0100)
commit534638eae31a51eca76de8b829b81e6c1fee083b
tree7f52200cea4c243c509d26f5e4d005ebe901c202
parentdd927f47e78bfdd89b62d5ef1ccd4b0a9b05386f
[mlir][linalg] Fix crash in canonicalization pattern

This crash was due to incorrect usage of `hasTensorSemantics`, which has changed recently with DestinationStyleOpInterface. An op has tensor semantics if all of its inits and inputs are tensors. Previously, only inits needed to be tensors.

Differential Revision: https://reviews.llvm.org/D137243
mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
mlir/test/Dialect/Linalg/canonicalize.mlir