[Mlir-commits] [mlir] 0bb0c7d - [MLIR][MPI] Fix direct getRefMutable().assign() bypassing rewriter in FoldCast (#188943)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Mon Mar 30 03:27:46 PDT 2026


Author: Mehdi Amini
Date: 2026-03-30T12:27:41+02:00
New Revision: 0bb0c7db2bd158a7515ba9726bc27fe9acc368b6

URL: https://github.com/llvm/llvm-project/commit/0bb0c7db2bd158a7515ba9726bc27fe9acc368b6
DIFF: https://github.com/llvm/llvm-project/commit/0bb0c7db2bd158a7515ba9726bc27fe9acc368b6.diff

LOG: [MLIR][MPI] Fix direct getRefMutable().assign() bypassing rewriter in FoldCast (#188943)

The FoldCast canonicalization pattern was calling
op.getRefMutable().assign(src) directly, bypassing the rewriter. This
violates the pattern API contract and causes fingerprint change failures
when
MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS is enabled. Wrap the
modification with b.modifyOpInPlace() to properly notify the rewriter of
the changes.

Assisted-by: Claude Code
Fix a failure present with MLIR_ENABLE_EXPENSIVE_PATTERN_API_CHECKS=ON.

Added: 
    

Modified: 
    mlir/lib/Dialect/MPI/IR/MPIOps.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/MPI/IR/MPIOps.cpp b/mlir/lib/Dialect/MPI/IR/MPIOps.cpp
index e5e09e28998ba..3c93029f0d37f 100644
--- a/mlir/lib/Dialect/MPI/IR/MPIOps.cpp
+++ b/mlir/lib/Dialect/MPI/IR/MPIOps.cpp
@@ -52,7 +52,7 @@ struct FoldCast final : public mlir::OpRewritePattern<OpT> {
     if (!src.getType().hasStaticShape()) {
       return mlir::failure();
     }
-    op.getRefMutable().assign(src);
+    b.modifyOpInPlace(op, [&]() { op.getRefMutable().assign(src); });
     return mlir::success();
   }
 };


        


More information about the Mlir-commits mailing list