<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/139785>139785</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[MLIR] Existing Python bindings issues
</td>
</tr>
<tr>
<th>Labels</th>
<td>
mlir
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
makslevental
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
makslevental
</td>
</tr>
</table>
<pre>
I plan to propose a partial rewrite/refactor of the Python bindings later this year. This github issue collects up some of the problems I've noticed/identified and some associated PRs/issues
1. Decoupled/divorced lifetimes between C++/C/Python; succinctly this revolves around `liveOperations`
- https://github.com/llvm/llvm-project/pull/93339
- https://github.com/llvm/llvm-project/issues/69730
- https://github.com/llvm/llvm-project/issues/92344
- https://github.com/llvm/llvm-project/issues/93337
- https://github.com/llvm/llvm-project/issues/63916
- half-hearted attempt fix via removal: https://github.com/llvm/llvm-project/pull/92631
- unfinished weak-ref system: https://github.com/llvm/llvm-project/pull/97340
2. The CMake build system is "mysterious and important", which is to say it's abstruse and inflexible; succinctly this affects modularity vis-a-vis piecemeal dialect registration/distribution
- https://github.com/llvm/llvm-project/issues/74245
- https://github.com/llvm/llvm-project/blob/5e83a5b4752da6631d79c446f21e5d128b5c5495/mlir/examples/standalone/python/CMakeLists.txt#L43
- https://github.com/llvm/llvm-project/pull/74252
- https://github.com/llvm/llvm-project/pull/124878
- https://github.com/llvm/llvm-project/issues/108253
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJysld1urDgMx58mc2PNCBLCxwUX03aRKvVoj472BQIxg7eBoMTQztuvYNruSnuu2kpIEJH8bMf-2yZGukyItdB3QsrRPEeHK05snJBS6IeDWXjwof7vn0Pr7bV-hNmZCdjDHPzsI4KB2QQm4yDgSyBGIZuAvenYB_A98IDw88qDn6ClydJ0ieAMYwAeKMIVTTjBX9vnhXhYWqAYF4TOO4cdR1hmiH7Ed9QcfOtwjPAoZLEiTJ6pQytkQxYnpp7Qgpns7ZCJ0XdkGC38_BW3TRs8iuQsknN6ggfs_DK7_byl1YcOLTjqkWnECC3yC-IE90Le7U9zL2Rzi0aoO4hL19HUsbveggm4erdiBBP8MlkQeeJoxT9nDIbJT1HkiUjOAABHGJjnKNRZyEbI5hb8qfOjkI1z6_vrOAf_N3YsZDMvzgnZVEqpaqN8AvEWvmzyqlBfcOWDU0mVZd_BUUoV38DJVZXm_3KM648DmrAVgGHGcWbo6RVWMhBw9KtxQp0_nwqZq_TD2jL1NFEc0MILmudjwB7iNTKOX7JRqCwBkZzlJhOE-x_mGaFdyNk3OlCETcbbIpBf4l7_NM4-sJl4k7S8h5eBumHbyh6iuQKxkEUE00YOy6bj7czUO3yl1uHvqtv0_a7I0dvFmUB8hZXi0RxXijATdjiicWDJbMqFgBeKfCv8XV6RA7XLvvx6ootMZvrznNb5VshGY6mMbrNCS2vyXKW2qLosy3uZorapLFvd6azSQjajoyBkg69mnN3uQmQzWeP8tLW8-dYUZLPn54kixxO_spDqKVOfVOtbBRSZ1PLLbSOVWVmU33DzaVJKrQ62VrZSlTlgnRZZkeZ5odPDUPc5ln2mkqwyOsmzErM-z9sixb5StlTpgWqZSJ3oVMkk0To9oUzLJNNVVRZlUchEZAmOhtxp8-Dkw-Ww265TVRWlPjjToovvs2vPyj6zQr173C6XKLLE7Rn4IDCx2-fdj6fHX0I_wB-vFJmmy_9m0y3OwxJc_YU7urm61vKfAAAA__9Jr2ox">