[mlir][vector] Fold extractOp coming from broadcastOp
authorThomas Raoux <thomasraoux@google.com>
Tue, 6 Oct 2020 16:56:35 +0000 (09:56 -0700)
committerThomas Raoux <thomasraoux@google.com>
Tue, 6 Oct 2020 17:27:39 +0000 (10:27 -0700)
commit92e83afe44fbfd81ffd428bb41b7f760eee712f9
tree8f1141ae1111db0b13f42d2a764391b75b902a0f
parentacce6b6082684d601e0375818260226259d96b7a
[mlir][vector] Fold extractOp coming from broadcastOp

Combine ExtractOp with scalar result with BroadcastOp source. This is useful to
be able to incrementally convert degenerated vector of one element into scalar.

Differential Revision: https://reviews.llvm.org/D88751
mlir/lib/Dialect/Vector/VectorOps.cpp
mlir/test/Dialect/Vector/canonicalize.mlir