[MLIR][Shape] Allow unsafe `shape.broadcast`
authorFrederik Gossen <frgossen@google.com>
Fri, 31 Jul 2020 14:17:31 +0000 (14:17 +0000)
committerFrederik Gossen <frgossen@google.com>
Fri, 31 Jul 2020 14:18:06 +0000 (14:18 +0000)
commit6983cf3a57aa6d8619eb39e1625eed5340ba05c7
treedfeedc88b0fef6be8634e6461fbf01c4159283fb
parent2da9b44415ce7958d09da53746ad46be631dcf1f
[MLIR][Shape] Allow unsafe `shape.broadcast`

In a context in which `shape.broadcast` is known not to produce an error value,
we want it to operate solely on extent tensors. The operation's behavior is
then undefined in the error case as the result type cannot hold this value.

Differential Revision: https://reviews.llvm.org/D84933
mlir/include/mlir/Dialect/Shape/IR/ShapeOps.td
mlir/test/Dialect/Shape/canonicalize.mlir
mlir/test/Dialect/Shape/invalid.mlir