diff options
author | Perry Gibson <Wheest@users.noreply.github.com> | 2024-11-20 00:00:57 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-11-19 19:00:57 -0500 |
commit | 21df32511b558b2c1e24fe23f677fffaad4da333 (patch) | |
tree | 037751ba9d16f389f4161c157fa4d3138bed0052 /llvm/lib/CodeGen/MachineSink.cpp | |
parent | 581f755a2a22910da8a9a160c4ea5efeb43a40b4 (diff) | |
download | llvm-21df32511b558b2c1e24fe23f677fffaad4da333.zip llvm-21df32511b558b2c1e24fe23f677fffaad4da333.tar.gz llvm-21df32511b558b2c1e24fe23f677fffaad4da333.tar.bz2 |
[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.
Diffstat (limited to 'llvm/lib/CodeGen/MachineSink.cpp')
0 files changed, 0 insertions, 0 deletions