[mlir] Fix casting of leading unit dims for vector.insert
authortyb0807 <vuson@google.com>
Thu, 30 Mar 2023 20:40:51 +0000 (20:40 +0000)
committertyb0807 <vuson@google.com>
Fri, 31 Mar 2023 12:12:35 +0000 (12:12 +0000)
commit942b403ff1a412778c9fb97bd53b44e35b544b0e
tree06f0fd3da744c3ca0a2f026f1de292c05f3bb943
parent9d2b84ef6232c7aa75963526ff4092fb8d8a3b50
[mlir] Fix casting of leading unit dims for vector.insert

When dropping leading unit dims of vector.insert's operands and creating
a new vector.insert, its new position rank should be computed explicitly
in two steps: first based on the numbers of leading unit dims dropped
from the vector.insert's destination, then based on the numbers of
leading unit dims dropped from its source.

Reviewed By: pifon2a

Differential Revision: https://reviews.llvm.org/D147280
mlir/lib/Dialect/Vector/Transforms/VectorDropLeadUnitDim.cpp
mlir/test/Dialect/Vector/vector-dropleadunitdim-transforms.mlir