[Mlir-commits] [mlir] [mlir] Add pack/unpack transpose foldings for linalg.generic ops, fix bugs (PR #93055)
Han-Chung Wang
llvmlistbot at llvm.org
Thu May 30 14:47:21 PDT 2024
================
@@ -314,12 +344,17 @@ struct FoldConsumerPackWithProducerLinalgTransposeOp
LogicalResult matchAndRewrite(PackOp packOp,
PatternRewriter &rewriter) const override {
- auto transposeOp = packOp.getSource().getDefiningOp<linalg::TransposeOp>();
+ auto linalgOp = packOp.getSource().getDefiningOp<linalg::LinalgOp>();
+ if (!linalgOp)
+ return failure();
- if (!transposeOp)
+ FailureOr<SmallVector<int64_t>> maybePerm =
+ getTransposeOpPermutation(linalgOp);
+ if (failed(maybePerm)) {
return failure();
+ }
----------------
hanhanW wrote:
style nit: remove `{}`
https://github.com/llvm/llvm-project/pull/93055
More information about the Mlir-commits
mailing list