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

    <tr>
        <th>Summary</th>
        <td>
            [MLIR] Error in coverting fptoui from arith to spirv
        </td>
    </tr>

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

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

    <tr>
      <th>Reporter</th>
      <td>
          stevesuzuki-arm
      </td>
    </tr>
</table>

<pre>
    ```
module attributes {} {
    func.func @fptoui(%arg0 : f32) -> i32 {
        %0 = arith.fptoui %arg0 : f32 to i32
        return %0 : i32
 }
}
```

```
mlir-opt --convert-arith-to-spirv
```
produces the error below
```
error: failed to legalize operation 'arith.fptoui' that was explicitly marked illegal
        %0 = arith.fptoui %arg0 : f32 to i32
```

Expected output:
```
module {
  func.func @fptoui(%arg0: f32) -> i32 {
    %0 = spirv.ConvertFToU %arg0 : f32 to i32
    return %0 : i32
  }
}
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykU91unDwQfRpzMwIZG5b1BRfJt1npk9qbqn0AAwO4MRjZ483P01ewSZNUm-5FEcIWnDPMnHOsQzDDjFiz8paVh0RHGp2vA-EJQ3yO9ybVfkoa1z3VbMdfbn5g_GZyXbQImsibJhIGYNUtqw7bsiEAAPo4t9n6AFbwfiEXDRN7JkrtBw5M3kAvBRMKUibvwEjxkb5eTJQr8gDaGxqzcxH4owSQW9kfmR4p-vm1wM07AKsO593b5uN0F19O1vjULQRp2rr5hJ7SraeUXBoW408XWYt3XWwxAI0I6L3z0KB1DxfB2_dtJm0sdutYFgdtzTOCW9BrMm6dqHovBhMV0KgJHnQAfFysaQ3ZJ5i0v8cOjN1K_KuqFxW6e1ywJezARVoiMfmJcuewvPP2r8G4movf3W-yZ_-d3Th-dz-uBuPzUFxPRdLVslNS6QTrfFfJMq-UqpKxRlEIUZaq3_NSYiNEWahGq142qLnK94mpBReS57nIOd_JKis09jzfKVkouauwYgXHSRubWXuaMueHxIQQsS6VKveJ1Q3a8HpKfb2C0iYOgRXcmkDhjUaG7Haev375_xsrD3C3Rc7M0LpVJDMP8OJ279109n9VaZMyid7WI9ESVivFkYnjYGiMTda6iYnj-puXJV28-4ktMXHcWg1MHLdufwUAAP__8lk6Jw">