[Mlir-commits] [mlir] [MLIR][Vector]Generalize DropUnitDimFromElementwiseOps (PR #92934)
Benjamin Maxwell
llvmlistbot at llvm.org
Mon Jun 3 10:15:55 PDT 2024
================
@@ -1607,7 +1607,27 @@ struct ChainedReduction final : OpRewritePattern<vector::ReductionOp> {
}
};
-/// For vectors with either leading or trailing unit dim, replaces:
+/// Drop unit dimension of the input VectorType. Scalable dimensions cannot be
+/// folded as we do not want to merge them through a shape_cast and create ill
+/// shaped scalable sizes.
----------------
MacDue wrote:
Not really, the main point is you have have to preserve the number of elements in the vector type. A unit dim does not change the number of elements in a vector (so can be dropped). A scalable one dim (which is not a unit dim) contains vscale elements, so dropping it divides the number of elements in the vector by vscale -- which obviously does not preserve the number of elements in the vector type.
https://github.com/llvm/llvm-project/pull/92934
More information about the Mlir-commits
mailing list