[Mlir-commits] [mlir] [mlir][Vectorizer] Added support to Vectorize tensor.unpack (PR #76087)
Diego Caballero
llvmlistbot at llvm.org
Fri Feb 16 18:45:07 PST 2024
================
@@ -38,7 +38,21 @@ computeTransposedType(RankedTensorType rankedTensorType,
/// i.e. for a pack from an ABCD layout to an ABCDba:
/// The packed shape would be ABCDba.
/// The pre-permutation shape would be AaBbCD.
-SmallVector<int64_t> getPackInverseDestPermutation(PackOp packOp);
+SmallVector<int64_t> computePackUnPackPerm(int64_t rank,
+ ArrayRef<int64_t> &innerDimsPos,
+ ArrayRef<int64_t> &outerPerm,
+ PackingMetadata &packingMetadata);
+
+/// This function uses the helper function `computePackUnPackPerm` to get
+/// the permutation vector. Only major difference between UnPack and Pack is
+/// that packOp uses destination rank whereas unpack Uses source rank.
+SmallVector<int64_t> getPackInverseDestPerm(tensor::PackOp packOp);
+SmallVector<int64_t> getUnPackInverseSrcPerm(tensor::UnPackOp unpackOp);
+
+/// Unpack requires some packing metadata data, so create another
+/// function where this value is passed by reference.
----------------
dcaballe wrote:
Same, I would add a comment about the metadata to be main doc above, then move this function back to back with 50.
https://github.com/llvm/llvm-project/pull/76087
More information about the Mlir-commits
mailing list