[Mlir-commits] [mlir] [MLIR] Don't drop attached discardable attributes (PR #111261)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Oct 7 15:07:15 PDT 2024


================
@@ -4337,11 +4337,16 @@ LogicalResult PackOp::canonicalize(PackOp packOp, PatternRewriter &rewriter) {
       dest =
           rewriter.create<tensor::CastOp>(loc, newDestType, packOp.getDest());
     }
-    Value newOp = rewriter.create<tensor::PackOp>(
-        loc, source, dest, packOp.getInnerDimsPos(), packOp.getMixedTiles(),
-        packOp.getPaddingValue(), packOp.getOuterDimsPerm());
+    auto clonedPackOp = cast<PackOp>(rewriter.clone(*packOp));
----------------
MaheshRavishankar wrote:

Sorry didnt get to review before it landed but you could use
```
auto discardableAttributes = getPrunedAttributeList(packOp, PackOp::getAttributesList());
clonedPackOp.setAttrs(discardableAttributes);
```

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


More information about the Mlir-commits mailing list