[mlir][Vector] Add a folder for vector.broadcast
authorHanhan Wang <hanchung@google.com>
Thu, 17 Sep 2020 15:54:16 +0000 (08:54 -0700)
committerHanhan Wang <hanchung@google.com>
Thu, 17 Sep 2020 15:54:51 +0000 (08:54 -0700)
commitf16abe5f84eee8db18d5eb5a21ab543146626ea6
tree669c33edaff7952d77439c7a22b012a6249609b3
parent7f1f89ec8d9944559042bb6d3b1132eabe3409de
[mlir][Vector] Add a folder for vector.broadcast

Fold the operation if the source is a scalar constant or splat constant.

Update transform-patterns-matmul-to-vector.mlir because the broadcast ops are folded in the conversion.

Reviewed By: aartbik

Differential Revision: https://reviews.llvm.org/D87703
mlir/include/mlir/Dialect/Vector/VectorOps.td
mlir/lib/Dialect/Vector/VectorOps.cpp
mlir/test/Dialect/Linalg/transform-patterns-matmul-to-vector.mlir
mlir/test/Dialect/Vector/canonicalize.mlir