<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/158098>158098</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            [MLIR][tblgen] Emit missing compund assignment operator for any BitEnum attribute’s enum type
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            mlir
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          amd-eochoalo
      </td>
    </tr>
</table>

<pre>
    When defining a `BitEnumAttr` and `enum class` is also generated. This `enum class` will have the following operators being defined:

https://github.com/llvm/llvm-project/blob/89e32acde5a8a0059219ca319ee6bb2114104b49/mlir/tools/mlir-tblgen/EnumsGen.cpp#L364-L367

Adding missing compound assignment operators `|=`, `&=`, `^=`, would be an improvement that would make some code more concise. For example, in the VectorToSPIRV lowering process, we have some lines of code that could be simplified from:

```
auto memoryAccess = spirv::MemoryAccess::None
memoryAccess = memoryAccess | spirv::MemoryAccess::Aligned;
```

to

```
memoryAccess |= spirv::MemoryAccess::Aligned;
```
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUVF1v5CYU_TX45SojjL8f_OBk4mqlbFVtV9tnbO6MaYFrAZ40_77CM9vdJP3QSkhwL3DOAc5FhqDPDrFn1T2rjpnc4kK-l1bdIc0LSUPZROql_21BBwpP2ml3Bgms5vc6PrrNDjF6VnOQTqUsus3CbGQIKakDSBMIzujQy4jqAJ8XHd4vfNbGwCIvCHFBOJEx9JyYaE37yAeYMMW7BFSsGBhPbYlxDSkSIxPjWcdlmw4zWSZGYy5fu7vV0-84RybGydDExNh2WAg5K6xkKzmvOpF3syzyDrGeJpHnZc7LqeyYGK3RnokxEplwC-_iZM7omBjTDYSf0B3mdWWieCrq8u6pqJurukGpJNrqEFI_k11pcwqu127Rxe8OyGrOmgdWHNNAPOyxqF_H1eO3-Jk2o2BCkA60XT1dcEeMi4y3SSv_QAhkEWZSCJZ8GrlZBzzASB7wT2lXgwlOu_3qv-AcyX-mX3_58OkLGHpGn6SvnmYMYefF60PtuEY7DECnK8FOPX_VFbRdjT5pVHDyZP9-s6T_2vggt0hg0ZJ_GebEAKw4Qli1v6T1xfDxu7lr5mdyyPjwbtPrRPPw3yiDScZXrLh_o4jxIdJ7oW_R_1fmPxNkqi9UV3Qywz5vqqbmZVUU2dI3bTthO5XNXJcqV01Z4UnJsuWqleWETaZ7wUXFuzzPK9FWxaHK6w5RNUVRtm3bSFZytFKbQ3L8gfw50yFs2OdVy7s2M3JCE_ZCF-LqaZFK3vd7hUzbObCSGx1i-IYQdTT75_Dx6cMnVh1ZdX-zfnWER6vjK2__i7XhRB6ke4HbjwEyRq-nLSJ7FKzlrOsC7N9BfFkx27zpf7is96Om8ryd9tKLvwIAAP__q9KMpQ">