[Mlir-commits] [mlir] 38c6493 - [MLIR][X86] Fix direct use.set() bypassing rewriter in rewriteUses (#188945)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Fri Mar 27 03:48:05 PDT 2026


Author: Mehdi Amini
Date: 2026-03-27T11:48:01+01:00
New Revision: 38c6493c894c74fc64e58a46f0896c25ba6347f3

URL: https://github.com/llvm/llvm-project/commit/38c6493c894c74fc64e58a46f0896c25ba6347f3
DIFF: https://github.com/llvm/llvm-project/commit/38c6493c894c74fc64e58a46f0896c25ba6347f3.diff

LOG: [MLIR][X86] Fix direct use.set() bypassing rewriter in rewriteUses (#188945)

rewriteUses was calling use.set(newVal) directly on OpOperand
references, 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 rewriter.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/X86/Transforms/VectorContractToPackedTypeDotProduct.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Dialect/X86/Transforms/VectorContractToPackedTypeDotProduct.cpp b/mlir/lib/Dialect/X86/Transforms/VectorContractToPackedTypeDotProduct.cpp
index cdf0c3925d6a3..a4496f3620b97 100644
--- a/mlir/lib/Dialect/X86/Transforms/VectorContractToPackedTypeDotProduct.cpp
+++ b/mlir/lib/Dialect/X86/Transforms/VectorContractToPackedTypeDotProduct.cpp
@@ -49,11 +49,10 @@ static void rewriteUses(mlir::Value oldVal, mlir::Value newVal,
                         mlir::Operation *targetContract,
                         mlir::PatternRewriter &rewriter) {
   for (mlir::OpOperand &use : llvm::make_early_inc_range(oldVal.getUses())) {
-
     mlir::Operation *user = use.getOwner();
     if (mlir::isa<mlir::vector::ContractionOp>(user) ||
         mlir::isa<mlir::scf::ForOp>(user)) {
-      use.set(newVal);
+      rewriter.modifyOpInPlace(user, [&]() { use.set(newVal); });
     }
   }
 }


        


More information about the Mlir-commits mailing list