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

    <tr>
        <th>Summary</th>
        <td>
            [mlir][tosa] Replace `StringBasedAttr` TOSA enumerations with `Tosa_I32EnumAttr`
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            good first issue,
            mlir:tosa
      </td>
    </tr>

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

    <tr>
      <th>Reporter</th>
      <td>
          lhutton1
      </td>
    </tr>
</table>

<pre>
    The TOSA enumerations defined in the specification here: https://mltech.ml.arm.com/spec/tosa/nightly-stable/tosa_spec.html#_enumerations are currently represented in the dialect using `StringBasedAttr`. This means we need to compare strings to when checking the value of the attribute e.g. https://github.com/llvm/llvm-project/blob/98a6fed0965702619162243be263626380a6c0f6/mlir/include/mlir/Dialect/Tosa/IR/TosaTypesBase.td#L244. Currently the following enumerations are represented this way: `Tosa_ResizeTypeAttr`, `Tosa_NanPropagationAttr` and `Tosa_RoundingTypeAttr`, here: https://github.com/llvm/llvm-project/blob/98a6fed0965702619162243be263626380a6c0f6/mlir/include/mlir/Dialect/Tosa/IR/TosaTypesBase.td#L239-L240

A more natural way to represent these enumerations would be using a `Tosa_I32EnumAttr`, similar to profiles and extensions here: https://github.com/llvm/llvm-project/blob/main/mlir/include/mlir/Dialect/Tosa/IR/TosaOpBase.td#L261. Therefore, this task is to rewrite `Tosa_ResizeTypeAttr`, `Tosa_NanPropagationAttr` and `Tosa_RoundingTypeAttr` enumerations using `Tosa_I32EnumAttr`.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzMlMFvpDYUxv8ac7GC4HlwhgOHSVKklVbdKjv3yOAHuGtsZD8ynf71lcl0kmzTQ1tV2hNg-3329_PjUzGa0SE2rLpj1UOmVpp8aOy0EnlXZp3X5-Y4IT9--Xrg6NYZgyLjXeQaB-NQc-M4Tcjjgr0ZTL_N8gkDMnHgE9ESmTgwaBm0syXsp3y2uQpz3vuZQZvqGLTko2LQOjNOZM83kVRn8TL-lNbkE82WgXh6dwgVkPdrCOjInnnAJWBER6_H0kZZ7Imv0biRM1l8pWDceKci6gNRYLLI-XEykc-oXOQn5A5Rc_K89_OS9ONWEdPQaULH-wn7b0kt6T8ruyL3w_ahiILpVkKO-Zh_Z340NK3dxbW1z38-bpbgf8WeGLSd9R2Dtt4rOaAualndFiDLupQAO9EhSCFBin2hZF8MciNqAoPWuN6uGl8HHl5sM2iPL2A_PV7ej-cFY7Kfk2YgPsNul_P7K8JkY_DW-lNy-BfWbwlTonZS53TPTBZJ_OkRo_kd0x4XuAzur5M_K_dL8IsaN8HLAq6cfi33q9PGjd8JfNxNPypQUd98hl3BigMrDgc--4DcKVqDsglX6qMrxsQ74nvOJ79azTu89Ky60vkk4Ce3zm_ARDMbq0KSXIIfjMW48cTfCF3c1P4ru1kZ96-4fFneQpFl-s0w4OADpqNv3UMqfuMmviA5BUP4P3bSe8rXQPgAbZ7pRuha1CrDprytdqKu9rLMpqavC6i1Kuqu3Mtyr3qp9E4IDVIpITuRmQYKqIp9UZVQlkWZ17red-VtqYeuq7So2a7AWRmbJ9y5D2NmYlyxKSsooc6s6tDGLY4BRu81H0yIxLdFDIDBPQPY4IvDS2hCCu7QbNfXrWNku8KaSPF1BzJkt4jf6qoHVt1tpdUDf8TFqh4_TsYPUv9kaPobatkabPOP22wzFhm0FwDPDfwRAAD__7tWLwY">