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

    <tr>
        <th>Summary</th>
        <td>
            [HLSL] Report error when register binding range overflows UINT32_MAX value
        </td>
    </tr>

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

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

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

<pre>
    The compiler should report an error when the upper bound of register binding is larger than UINT32_MAX:

```
RWBuffer<float> Buf[10] : register(u4294967294); // UINT32_MAX - 1

[numthreads(1, 1, 1)]
void main() {
  Buf[1][0] = 0;
}
```
https://godbolt.org/z/KM3fPoY74

**Current behavior:**
Clang with `-Od` ignores the binding (resource is not bound).
Clang without `-Od` crashes in `OpLowerer`.
DXC does not report an error if the register range starts at `UINT32_MAX - 1` and it overflows the register slot.
DXC with register range starting at `UINT32_MAX` ignores the binding and assigns the resource `u0`.


</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx0U12v4zQQ_TWTl9GtXDtukoc8JC0ViLssWhaxPCGnmSQG16780Sv49ShputstrDRqJcc-Z845MyoEPVqiGmQL8pCpFCfn64n-clFlnev_rj9OhCd3vmhDHsPkkunR08X5iMoiee88vk1kMU6E6XIhj51Ltkc3oKdRhzifaNtrO6IOaJQfyWOclMVff_jpo-B_vGs-gWiALbVja7Hmw29tGgbyIPaDcSqC-A7bNIBstwzkAUE0nymAlynnVV7tCl7lwCsQLQI_Aj8-0OALblce2dp0jpMn1Qfg5Rb4Hu8_FcgDsObqdI9npS3wEniFULTAGrz3MF-S7drJARmI-TMUhycZU4yXMAtcuhld3zkTN86PwI__AD_--E4MP7vfi3ztjM-1T96TjdjRpK7a-eX9UqzZG2VHfNNxQtixl_c97Bjq0TpPYYnhbjfw0lNwyZ9ott66eMsGeLX5Csel-AB18ipMFFDb-fD95dW9kScPOza_OnzaY-_oBvc8CXpYGvgcvFd2JAxR-RhQLSRPaewYKtujjuiu5Afj3sLXEMG4eOddNP8f-Kz2Gf5brsx0t8G_M60WwY4ltqoE1mR9LfpKVCqjelvkUpTbsuTZVCuSQhWs6LalZKpkTA5iUKKQoqjyQZSZrjnjkuVcsHxbMr4pq2qQBVOFZCfJSULO6Ky02RhzPc-jkOkQEtVbsStZlRnVkQnLUnL-_esvr8D5vJ6-nu-_dGkMkDOjQwxfEKKOZlnk5YE84IdbNg8r-p99vDn4xfiHbK7KJMqSN_XT_Oo4pW5zcmfgx5l8_Xu5ePcnnSLw46IlAD-ucq41_zcAAP__J-JdFw">