[mlir][MemRef] Add early exit for computing dropped unit-dims.
authorMahesh Ravishankar <ravishankarm@google.com>
Fri, 18 Mar 2022 16:36:16 +0000 (16:36 +0000)
committerMahesh Ravishankar <ravishankarm@google.com>
Mon, 21 Mar 2022 21:50:29 +0000 (21:50 +0000)
commitb40f420c2b64ff902ddf16fba1d9920acad11fbc
tree2fcac2c91a0e1749fc80fbf1791150f378978977
parent5b811586758808ce3335272d5b41852cf87666c7
[mlir][MemRef] Add early exit for computing dropped unit-dims.

Computing dropped unit-dims when all the unit dims are dropped, does
not need to check for strides being dropped.
This also enables canonicalization of reduced-rank subviews.

Reviewed By: gysit

Differential Revision: https://reviews.llvm.org/D121766
mlir/lib/Dialect/MemRef/IR/MemRefOps.cpp
mlir/test/Dialect/MemRef/canonicalize.mlir
mlir/test/Dialect/MemRef/invalid.mlir