[Mlir-commits] [mlir] [mlir] Migrate users to explicitly discardable/inherent attribute APIs (PR #217233)

Frank Schlimbach llvmlistbot at llvm.org
Wed Aug 19 01:54:08 PDT 2026


================
@@ -84,7 +84,10 @@ void populateAllReduceEndomorphismSimplifyPatterns(RewritePatternSet &patterns,
 
     auto refAllReduceOp = llvm::dyn_cast<AllReduceOp>(referenceOp.value());
     auto refType = cast<ShapedType>(refAllReduceOp.getResult().getType());
-    return refAllReduceOp->getAttrs() == allReduceOp->getAttrs() &&
+    return refAllReduceOp.getGridAttr() == allReduceOp.getGridAttr() &&
+           refAllReduceOp.getGridAxesAttr() == allReduceOp.getGridAxesAttr() &&
+           refAllReduceOp->getDiscardableAttrDictionary() ==
+               allReduceOp->getDiscardableAttrDictionary() &&
            inType.getElementType() == refType.getElementType();
----------------
fschlimb wrote:

```suggestion
    return refAllReduceOp.getGridAttr() == allReduceOp.getGridAttr() &&
           refAllReduceOp.getGridAxesAttr() == allReduceOp.getGridAxesAttr() &&
           refAllReduceOp.getReductionAttr() == allReduceOp.getReductionAttr() &&
           refAllReduceOp->getDiscardableAttrDictionary() ==
               allReduceOp->getDiscardableAttrDictionary() &&
inType.getElementType() == refType.getElementType();
```

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


More information about the Mlir-commits mailing list