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

    <tr>
        <th>Summary</th>
        <td>
            [HLSL][SPIRV] Hitting assert when compiling program with 'asint' in HLSL
        </td>
    </tr>

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

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

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

<pre>
    Hitting an assert when compiling this program with spirv: '-spirv -fspv-target-env=vulkan1.3 -T cs_6_5'
```
StructuredBuffer<float4> In3 : register(t2);
RWStructuredBuffer<int4> Out3 : register(u5);

[numthreads(1,1,1)]
void main() {
  // float
  Out3[0] = asint(In3[0]);
}
```

```
Assertion failed: TargetType->getElementType() == SourceType->getElementType(), file llvm-project/llvm/lib/Target/SPIRV/SPIRVLegalizePointerCast.cpp, line 78
```

https://godbolt.org/z/rfoGz3Kj9
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJx8U02PozgQ_TXFxUpkyjiEA4ckNDutbWlHk9bucWSgAM8ag2yT1vSvX0HS09sfGsmRVeW8elWveMp73VmiHOQRZBGpOfSjy_2kjImqsfmZf9EhaNsxZZnynlxgTz1ZVo_DpM3yEHrt2eTGzqmBPenQMz9pdwFxYIDpZg3YpvXTZROU6yhsyF5AFJfZ_KtsvBVs88hq_333XQKmwA-w47fDD-fg5jrMjprj3LbkQJxaM6qQgLhj91awhcZRp30gB7gPCJiBOAI_fPvnE7C2V-hfc_iAneUv7HLk0c5D6B2pxgPuY8DT7ZeBLIAfLqNu2KC0BdwDZgzSBcoYYAlYsrXPNbGQgTxykAUDUTDltQ2A-3v7kn4lTot3CrwLD-sO9GhZq7ShZpnhcZX18edEGxB3HYU7QwPZNfPSmygW5vM4u5p-90_AE2u1IWbMZdhMbvxBdQAsl3C5dAVYXgkBy_PX-29_v9wP1Cmjn-nrqG0gd1I-bOtpWioabYml-4-j9SFMHsThqlk3NtVownZ0HWD5DFi6dvzjWfz5I4uaXDSZyFREeZzKWKY8SXnU5zteZ0I2KYqMK6kwi2Uis1ilMpUZURXpHDlKnnIRZxjHfJtImal6pxRRTG2VQMJpUNpslxkX7kh7P1MeJ7sswcioioxfDYJo6Ymtr4C4-MXlq07V3HlIuNE--NcyQQezOuvLw_lh2bI8XgWTBftlq0899cZOgOnti0mZtmwpFs3O5O-006Gfq209Dv_b1tsdro17wPI22SXH_wIAAP__GQI4ww">