[Mlir-commits] [mlir] [mlir][linalg] Support lowering unpack with outer_dims_perm (PR #94477)

Han-Chung Wang llvmlistbot at llvm.org
Wed Jun 5 15:26:03 PDT 2024


================
@@ -391,45 +384,42 @@ FailureOr<LowerUnPackOpResult> linalg::lowerUnPack(RewriterBase &rewriter,
     return LowerUnPackOpResult{/*emptyOp=*/nullptr, /*transposeOp=*/nullptr,
                                /*reshapeOp=*/nullptr, extractSliceOp};
   }
-  // 2. Compute the permutation vector to move the last `numPackedDims` into
-  // the `innerPosDims` of a shape of rank `packedRank`.
-  int64_t numPackedDims = unPackOp.getInnerDimsPos().size();
-  auto lastDims = llvm::to_vector(
-      llvm::seq<int64_t>(packedRank - numPackedDims, packedRank));
-  PackingMetadata packingMetadata =
-      computePackingMetadata(packedRank, unPackOp.getInnerDimsPos());
-  SmallVector<int64_t> lastDimsToInsertPositionsPerm = computePermutationVector(
-      packedRank, lastDims, packingMetadata.insertPositions);
+
+  // 2. Compute the permutation vector to shuffle packed shape into the shape
----------------
hanhanW wrote:

This is why I don't like itemize comments using `1.`, `2.`, `3.`, etc. Now `1.` is gone, so you need to update all the comments. Can you update them?

```suggestion
  // 1. Compute the permutation vector to shuffle packed shape into the shape
```

https://github.com/llvm/llvm-project/pull/94477


More information about the Mlir-commits mailing list