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-12 20:35:46 -08:00
2024-08-27 18:44:50 -04:00
2024-04-24 07:43:05 -05:00
2024-05-13 09:08:04 +02:00
2023-11-12 20:35:46 -08:00
2024-11-19 15:24:39 -06:00
2024-10-02 09:07:55 -07:00
2023-12-15 13:04:43 +01:00
2023-12-11 09:43:08 +00:00
2023-11-07 10:49:41 -06:00
2023-11-12 20:35:46 -08:00
2023-11-12 20:35:46 -08:00
2024-11-13 01:23:10 -05:00
2024-11-19 19:00:57 -05:00
2023-12-11 09:43:08 +00:00
2023-11-20 19:54:55 -06:00
2024-06-20 10:15:08 -05:00
2024-10-04 09:23:12 +02:00
2024-11-11 09:26:15 +01:00
2024-09-18 11:54:16 +08:00
2023-11-07 10:49:41 -06:00
2023-10-30 14:46:21 -07:00
2024-06-11 07:45:12 -07:00
2024-06-11 07:45:12 -07:00
2024-04-17 15:01:59 +02:00