[Mlir-commits] [mlir] [mlir][Tensor] Retain discardable attrs back in cast(pack) folder (PR #115772)
Mehdi Amini
llvmlistbot at llvm.org
Mon Nov 11 13:52:52 PST 2024
================
@@ -4798,6 +4798,7 @@ struct FoldTensorCastPackOp : public OpRewritePattern<PackOp> {
PackOp newOp = rewriter.create<PackOp>(
op.getLoc(), newOperands[0], newOperands[1], op.getInnerDimsPos(),
newMixedTileSizes, op.getPaddingValue(), op.getOuterDimsPerm());
+ newOp->setDiscardableAttrs(op->getDiscardableAttrDictionary());
----------------
joker-eph wrote:
Why is this sounds? How do you guarantee that the pattern can't invalidate anything encoded in there?
We don't have a principled approach to this in general unfortunately, here the pattern replace the op so it was visible, other folders operate in-place and are propagating "by accident".
By the way: can't this pattern just operate in-place here instead?
https://github.com/llvm/llvm-project/pull/115772
More information about the Mlir-commits
mailing list