[Mlir-commits] [mlir] [MLIR][X86] Fix direct use.set() bypassing rewriter in rewriteUses (PR #188945)
llvmlistbot at llvm.org
llvmlistbot at llvm.org
Fri Mar 27 03:17:21 PDT 2026
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-mlir
Author: Mehdi Amini (joker-eph)
<details>
<summary>Changes</summary>
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.
---
Full diff: https://github.com/llvm/llvm-project/pull/188945.diff
1 Files Affected:
- (modified) mlir/lib/Dialect/X86/Transforms/VectorContractToPackedTypeDotProduct.cpp (+1-2)
``````````diff
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); });
}
}
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/188945
More information about the Mlir-commits
mailing list