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

    <tr>
        <th>Summary</th>
        <td>
            [Clang][AMDGPU] Clang crashes on `__builtin_coro_noop` when targeting AMDGPU
        </td>
    </tr>

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

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

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

<pre>
    Any use of `__builtin_coro_noop` will cause the AMDGPU target to crash with an invalid constexpr crash. The NVPTX and other targets handle this just fine. https://godbolt.org/z/9E18bG3d6

```c
void foo() {
 __builtin_coro_noop();
}
```
```console
$ clang++ -std=C++23 --target=amdgcn-amd-amdhsa bug.cpp
clang++: /root/llvm-project/llvm/lib/IR/Constants.cpp:2191: static llvm::Constant* llvm::ConstantExpr::getCast(unsigned int, llvm::Constant*, llvm::Type*, bool): Assertion `CastInst::castIsValid(opc, C, Ty) && "Invalid constantexpr cast!"' failed.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
```

</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycVMFu4zYQ_ZrxZWBBGlmydNBBtqNFgLYI2nTRW0CRtMSUJgWSym769QUlLZoE6WUBm8YMZ545j4-Pea8GI2UDxQmKy47NYbSueR7nXrpy11vx2rTmFWcv0V4RyvTpqZ-VDso8cevsk7F2gjLFb0pr5CzWhVFi--vly8OfGJgbZMBgkTvmR_ymwojMoDIvTCuB3Bof5PfJrfsJPo4Sf_v68PgXMiPQhlG6DcTjyIzQEV55fJ59wKsyMsExhMlD3gJ1QN1gRW91SKwbgLp_gLr6Lqv6L7koIb1A2m5rma4fvsYvVgm8WgtUAdUIx9Oax8_GXWog30rgePmA-fEvrPFWyy1LB-SamQHoBHTCvQ8C8st5DSnH_X6dF_ILu4mBmz27ifgdPcN-HhI-TSvUGxjIWwTqnLUBqNP65bafnH2W_EcYf1QP1N3_DtSdI-3MBL-A5S1ldRYhfGBBcVwa8hby9kchUPtJ9u775NbMIMOZ-QBUzWYRlEAVu86fY73feHyd5JbsrdULty223ksXlDVRdBH83viwNvAY-a9RQUCVnXhsPcfl8XW5PSqBSgSi-7c6Y2aT2nLSDIiAjnhlSkuRrJQ-_HLX_nGHfu5vKuDCNzo5Wbdo-IPSVBjnPuH29obj98wr72fpgbpFzcpwPYv1fazPoWf87-AYl_Hsk5OTs1x6LwV6O7s1HTuZ95YrFqRANxv03KkpJJ-qbieaXNR5zXayyY5EdZZndb4bG1Fmxys_HEVV1SlPRV-VmTxeRSXqND_k5U41lNIhrdIypaIuKCn7Q8WKK0vrrJCy4HBI5Y0pncQp4wPbLfM1WUppXew066X2i5EQbdqk6CmuWWjp58HDIdXKB_8fRFBBL-5zXjqKCxSn1TyguOCSXMmSHlct_J8BjdJsVqHMsBnQbna6-flr2yZ7aejfAAAA___7iZz-">