[mlir] Fix memref_cast + subview folder when reducing rank
authorThomas Raoux <thomasraoux@google.com>
Tue, 16 Feb 2021 19:03:58 +0000 (11:03 -0800)
committerThomas Raoux <thomasraoux@google.com>
Tue, 16 Feb 2021 20:00:59 +0000 (12:00 -0800)
commitadfd3c7083f9808d145239153c10f72eece485d8
tree53484638ff7038802248aaad693c36428ab6f784
parentcdef5a7161767c2c4b3b7cb2542cf1d29b6d4a09
[mlir] Fix memref_cast + subview folder when reducing rank

When the destination of the subview has a lower rank than its source we need to
fix the result type of the new subview op.

Differential Revision: https://reviews.llvm.org/D96804
mlir/lib/Dialect/StandardOps/IR/Ops.cpp
mlir/test/Dialect/Standard/canonicalize.mlir