llvm-project
ba55ef32 - [mlir][IR] Fix `RewriterBase::replaceUsesWithIf(ValueRange)` in dialect conversion (#172883)

Commit
73 days ago
[mlir][IR] Fix `RewriterBase::replaceUsesWithIf(ValueRange)` in dialect conversion (#172883) `ConversionPatternRewriter::replaceUsesWithIf` does not support the `allUsesReplaced` flag and asserts that it's not set. However the `ValueRange` overload of `RewriterBase::replaceUsesWithIf` always passes this flag when calling the virtual overload of `replaceUsesWithIf`. This means calls made to `RewriterBase::replaceUsesWithIf` from a `ConversionPattern` crash, whether the `allUsesReplaced` flag is set or not. This change tweaks `RewriterBase::replaceUsesWithIf` to only pass that flag if the callee has set it.
Parents
Loading