[MLIR][Shape] Add canonicalizations for `shape.broadcast`
authorFrederik Gossen <frgossen@google.com>
Thu, 22 Apr 2021 12:09:14 +0000 (14:09 +0200)
committerFrederik Gossen <frgossen@google.com>
Thu, 22 Apr 2021 12:11:23 +0000 (14:11 +0200)
commitf0c51cb2d4562fb97280326202eab23ff7b29e3f
tree02743d66cf64fefb6a29f4ad564bfb7262d82b90
parente3dd82ae3c4edaeb3c8f835c29566375ee25023d
[MLIR][Shape] Add canonicalizations for `shape.broadcast`

Eliminate empty shapes from the operands, partially fold all constant shape
operands, and fix normal folding.

Differential Revision: https://reviews.llvm.org/D100634
mlir/lib/Dialect/Shape/IR/Shape.cpp
mlir/test/Dialect/Shape/canonicalize.mlir