<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/150009>150009</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[mlir][python] Op properties are broken for python
</td>
</tr>
<tr>
<th>Labels</th>
<td>
mlir
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
fabianmcg
</td>
</tr>
</table>
<pre>
Op properties when used with python are broken in multiple ways:
1. They cannot be set when constructing an op from python, they result in dead args. For example, take `FatRawBufferCastOp`, it has `boundsCheck` and `resetOffset` as props, and the resulting python class init is:
```
def __init__(self, source, boundsCheck, resetOffset, *, validBytes=None, cacheSwizzleStride=None, loc=None, ip=None):
operands = []
results = []
attributes = {}
regions = None
operands.append(source)
operands.append(validBytes)
operands.append(cacheSwizzleStride)
_ods_context = _ods_get_default_loc_context(loc)
_ods_successors = None
super().__init__(self.OPERATION_NAME, self._ODS_REGIONS, self._ODS_OPERAND_SEGMENTS, self._ODS_RESULT_SEGMENTS, attributes=attributes, operands=operands, successors=_ods_successors, regions=regions, loc=loc, ip=ip)
```
2. Properties cannot be set from python (unless they are also an inherent attr).
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJxsVN1u4joQfhpzM9ooOE0gF7kAAquVzsKq9FxHjj0hPjV2ZDtl2ac_cpKl0FaKFHvmm59vZjzMOXnSiAVJ1yQtZ6z3rbFFw2rJ9JmfZrUR1-LQQWdNh9ZLdHBpUUPvUMBF-ha6q2-NBmYRamteUYPUcO6Vl51CuLCrI8mKxCsg8WoewUuLV-BMa-OhRnDoR4fcaOdtz73UJ2AaTAeNNefJPaEb8MHSouuVDyEEMgHMnlwEO2MBf7Nzp3AAslcEksU75p_ZZd03DdoNc_7QkSwOAOmhZS5AatNr4TYt8leSxQBMiyC26NAfmsahD2LmBv4u2AaEb3FKJCQ7FYAr5hxILT3IiXIIN37xCkBgA1UVAFVF6NKhaoJDZ3rLh7zvk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