[Mlir-commits] [mlir] [mlir][Tensor] Retain discardable attrs in pack(cast) folder (PR #115772)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Nov 12 23:27:56 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());
----------------
MaheshRavishankar wrote:

I am confused as to what then is the point of external attributes or discardable attributes then. 
I agree this isn't consistent. Like I said it's best effort.

I think the more important thing here is that this doesn't change the semantics of the transformation one bit from upstreams perspective. 

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


More information about the Mlir-commits mailing list