[Mlir-commits] [mlir] [mlir][IR] Make `RewriterBase::replaceOp` non-virtual (PR #160529)

Markus Böck llvmlistbot at llvm.org
Thu Sep 25 04:15:30 PDT 2025


================
@@ -900,7 +900,7 @@ class ConversionPatternRewriter final : public PatternRewriter {
   /// RewriterBase APIs, (3) may be removed in the future.
   void replaceAllUsesWith(Value from, ValueRange to);
   void replaceAllUsesWith(Value from, Value to) override {
-    replaceAllUsesWith(from, ValueRange{to});
+    replaceAllUsesWith(from, to ? ValueRange{to} : ValueRange{});
----------------
zero9178 wrote:

I see tests failing when removing this change and I am slightly confused why it is suddenly needed. 
Should we at least put a TODO here that this should be removed in the future and fix the users instead? IIRC this does not work in the greedy pattern rewriter and I think its best we keep the differences to a minimum

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


More information about the Mlir-commits mailing list