Perry Gibson
21df32511b
[mlir,python] Expose replaceAllUsesExcept to Python bindings (#115850)
Problem originally described in [the forums
here](https://discourse.llvm.org/t/mlir-python-expose-replaceallusesexcept/83068/1).
Using the MLIR Python bindings, the method
[`replaceAllUsesWith`](https://mlir.llvm.org/doxygen/classmlir_1_1Value.html#ac56b0fdb6246bcf7fa1805ba0eb71aa2)
for `Value` is exposed, e.g.,
```python
orig_value.replace_all_uses_with(
new_value
)
```
However, in my use-case I am separating a block into multiple blocks, so
thus want to exclude certain Operations from having their Values
replaced (since I want them to diverge).
Within Value, we have
[`replaceAllUsesExcept`](https://mlir.llvm.org/doxygen/classmlir_1_1Value.html#a9ec8d5c61f8a6aada4062f609372cce4),
where we can pass the Operations which should be skipped.
This is not currently exposed in the Python bindings: this PR fixes
this. Adds `replace_all_uses_except`, which works with individual
Operations, and lists of Operations.
2024-11-19 19:00:57 -05:00
..
2023-11-03 13:28:20 -05:00
2024-06-07 12:03:07 +02:00
2024-11-13 01:23:10 -05:00
2024-09-11 07:37:35 -04:00
2024-06-05 17:10:55 -05:00
2024-11-19 11:00:35 +09:00
2023-12-21 10:06:44 +00:00
2023-11-27 15:58:00 -06:00
2024-01-17 06:12:23 +03:00
2023-11-03 13:28:20 -05:00
2023-11-03 13:28:20 -05:00
2024-02-08 11:39:06 -08:00
2024-06-20 10:15:08 -05:00
2023-10-10 07:47:08 +02:00
2024-11-19 19:00:57 -05:00