[Mlir-commits] [mlir] [mlir][tensor] Fold producer linalg transpose with consumer tensor pack (PR #75658)

lorenzo chelini llvmlistbot at llvm.org
Mon Dec 18 01:10:03 PST 2023


================
@@ -21,6 +21,57 @@ static bool areAllConstantIntValue(ArrayRef<OpFoldResult> ofrs, int64_t value) {
       ofrs, [&](OpFoldResult ofr) { return isConstantIntValue(ofr, value); });
 }
 
+/// Helper function to generate an equivalent permutation map for
+/// `linalg.transpose` and `tensor.pack` which will be used after their folding
+/// into a `tensor.pack`.
+static bool getRemappedPermutationForTransposeAndPack(
+    PackOp packOp, linalg::TransposeOp transposeOp,
+    SmallVector<int64_t> &newOuterDimsPermVec,
+    SmallVector<int64_t> &newInnerDimsPosVec,
+    SmallVector<OpFoldResult> &newMixedInnerTilesVec,
+    bool isTransposeProducer) {
+  bool foldingPossible = true;
----------------
chelini wrote:

We can avoid this variable.

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


More information about the Mlir-commits mailing list