[MLIR][Shape] Ensure to preserve op type of `shape.broadcast`
authorFrederik Gossen <frgossen@google.com>
Mon, 26 Apr 2021 15:52:37 +0000 (17:52 +0200)
committerFrederik Gossen <frgossen@google.com>
Mon, 26 Apr 2021 15:55:39 +0000 (17:55 +0200)
commit858d4885dcc2242910971607bf46428d5b563d95
tree8029b0c0ccfbdf67515d581a1907c6f578ba8a82
parent18b03b008588e829751ab4b945982ee301a58839
[MLIR][Shape] Ensure to preserve op type of `shape.broadcast`

Ensure to preserve the correct type during when folding and canonicalization.
`shape.broadcast` of of a single operand can only be folded away if the argument
type is correct.

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