[mlir][shape] Fold shape.broadcast with one scalar operand
authorStephan Herhut <herhut@google.com>
Wed, 15 Jul 2020 07:25:39 +0000 (09:25 +0200)
committerStephan Herhut <herhut@google.com>
Wed, 15 Jul 2020 16:49:12 +0000 (18:49 +0200)
commit8ef47244b95f7b148e072a19563f6096ed4fe43c
tree898354dea0185f560f0364dd6323162b1dcebae2
parente122eba185055fb848cc7efc578035716dc1fec4
[mlir][shape] Fold shape.broadcast with one scalar operand

This folds shape.broadcast where at least one operand is a scalar to the
other operand.

Also add an assemblyFormat for shape.broadcast and shape.concat.

Differential Revision: https://reviews.llvm.org/D83854
mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
mlir/lib/Dialect/Shape/IR/Shape.cpp
mlir/test/Dialect/Shape/canonicalize.mlir
mlir/test/Dialect/Shape/ops.mlir