[Mlir-commits] [mlir] [mlir][Transforms] Dialect conversion: Add support for `replaceUsesWithIf` (PR #169606)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Dec 16 06:49:24 PST 2025


BabakkGraphcore wrote:

Hi, I just wanted to check whether there is a regression with this - 

The non-virtual `ValueRange` overload of `replaceUsesWithIf` defined on `PatternRewriter` calls through to the overloaded version with `allUsesReplaced` set, but the `ConversionPatternRewriter` implementation asserts that `allUsesReplaced` isnt set. You can "accidentallly" hit this if you call `mlir::makeRegionIsolatedFromAbove` using a `ConversionPatternRewriter`. 

https://github.com/llvm/llvm-project/blob/main/mlir/lib/Transforms/Utils/RegionUtils.cpp#L171
https://github.com/llvm/llvm-project/blob/main/mlir/lib/IR/PatternMatch.cpp#L282
https://github.com/llvm/llvm-project/blob/main/mlir/lib/Transforms/Utils/DialectConversion.cpp#L2230


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


More information about the Mlir-commits mailing list