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

    <tr>
        <th>Summary</th>
        <td>
            AMDGPU/TeraScale2: `Cannot select: t3: i32 = addrspacecast[0 -> 5] Constant:i32<0>` (crash, regression)
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            new issue
      </td>
    </tr>

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

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

<pre>
    I'm running Mesa Clover 22 against LLVM 15 (built from repositories)

When running [Luxmark 3.1](http://wiki.luxcorerender.org/LuxMark_v3#Binaries) OpenCL benchmark, I got this crash:

 ```
LLVM ERROR: Cannot select: t3: i32 = addrspacecast[0 -> 5] Constant:i32<0>
   t2: i32 = Constant<0>
In function: AdvancePaths_MK_DL_SAMPLE_BSDF
```

I reproduced the issue with this TeraScale 2 GPU:

- AMD Radeon HD 5870 RV870 Cypress XT.

I assume `AdvancePaths_MK_DL_SAMPLE_BSDF` is a LuxMark OpenCL function.

This is a regression as it works with older LLVM 20.0.4 and Mesa 9.0.1: http://luxmark.info/node/9192 (completed benchmark run on the exact same computer and installation, but running old builds of Mesa and LLVM instead).

_Note:_ TeraScale3 is affected by another issue: #54942
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJytVE1v4zYQ_TX0ZRCBpiwrOujg2HEb1O4GTrrdm0FJI4sNTRokFSf76zuUHSfuZS8FBAoU5-PNe4-qbPNePjCR78H1xiizgzV6CXNtX9GBECB3UhkfYLX6voZxBkzcVr3SAVpnKQkP1qtgnULPRMH4gvHZaf27Q3MpyrK7Vf-2l-4F0mTMsgWV6UI4sHTGxJKeo3pRie7fauvQoWnQJdbt6IDS1pS2fU2ZSO-UkedW8O2AZr6CCk3dxcJMzOEBdjZA6JSH2knfxfJfIAGb8vMz7IeZ7jebbxsKhLk0hrI9aqxD_BDSuKpUAEsXIJvG-YOssZY-0Dwcblh6DxkNA3NLFEkTsyicpXNOR-eeAEF8rfMZ-yXqwUDbmzooa2LsrHmVpsZHGTq_Xf-xXay2T7P14-p-e_e0WJ5Hup7lXCcq4mzT19gQDwjK-x7hqEJ3ouUZnXyqpUYQ8NvjX_8h6AZm6wVsZIPWwO8LyG5zDpvvcZ2_Hxx6Dz-ek-uGkjrsMVL7C9RTTmhAwlnRDwE_5r4q-xyxDtEOd7EvBVAnUAGO1r3400RWk09OzhQ84ckEpGlOBi5oO45UXrlMnzyYKNNa2hrbIL2KcSGir2u7P2gMxNzFVNHAQK0jlfgma7KHpGFjZB-od-wXr4fUWg7ikQmrPlx8TwghXpfGg21PyGLKADnmoWzIy1ejb_-0AQnx9lOrdKCibcmXEdw71bCEyJ3UjVPS3cgmxUSMmjJtirSQo6CCxpLkjCqL5aXW4EXS4n93O8kbORyuHbHwqRsNOOqdLqMS_iLFjgTsq4SYjLro14_XDdn3nwhJLIfp6K4vs2yaF6OurG6r23Qy5VK2oqrbaS5zJG8iLyY5FlU20rJC7UvCy4QweDwTJATBHqlScCF4JibjKc8zkWA-GVecN2mdp7zlFZtw3Eulk4gj_n5GrhwgVf3O06FWPvjPQzK-2hnEoR3Vl33orCuV1keF9cvP0dC8HMD_C7A1qxo">