[Mlir-commits] [mlir] [mlir][linalg] Add PackOp canonicalization pattern (PR #215785)
Hendrik Klug
llvmlistbot at llvm.org
Tue Aug 18 22:54:52 PDT 2026
================
@@ -6008,6 +6008,13 @@ LogicalResult PackOp::canonicalize(PackOp packOp, PatternRewriter &rewriter) {
}
}
+ // Fold pack(empty) to the destination tensor if no padding value is provided.
+ if (packOp.getSource().getDefiningOp<tensor::EmptyOp>() &&
----------------
HendrikKlug-synthara wrote:
I don't think this can happen with tensors, memrefs are not supported for now:
https://github.com/HendrikKlug-synthara/llvm-project/blob/ccd1577ab9300498adece1b57ca11f4f400cbd54/mlir/lib/Dialect/Linalg/IR/LinalgOps.cpp#L5996-L5998
Do you have a concrete example where this could fail?
https://github.com/llvm/llvm-project/pull/215785
More information about the Mlir-commits
mailing list