[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.

GitOrigin-RevId: ba55ef32ef9214804b421090767a27f14abd9439
1 file changed
tree: d783e6026dbed763dca4a55651e701920b4ad499
  1. benchmark/
  2. cmake/
  3. docs/
  4. examples/
  5. include/
  6. lib/
  7. python/
  8. test/
  9. tools/
  10. unittests/
  11. utils/
  12. .clang-format
  13. .clang-tidy
  14. CMakeLists.txt
  15. LICENSE.TXT
  16. Maintainers.md
  17. README.md
README.md

Multi-Level Intermediate Representation

See https://mlir.llvm.org/ for more information.