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

    <tr>
        <th>Summary</th>
        <td>
            [HLSL] Crash when wrong parameter type is used for entry point parameter with SV_GroupThreadID
        </td>
    </tr>

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

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

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

<pre>
    The compiler crashes with an assertion failure:
```
Assertion failed: isValidOperands(Vec, Elt, Index) && "Invalid insertelement instruction operands!", file D:/llvm-project/llvm/lib/IR/Instructions.cpp, line 1696
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0. Program arguments: D:\\llvm-project\\build\\bin\\clang-dxc.exe -enable-16bit-types -T cs_6_5 C:\\Users\\jbatista\\Desktop\\hlsl.hlsl
1.      <eof> parser at end of file
2.      C:\Users\jbatista\Desktop\hlsl.hlsl:3:6: LLVM IR generation of declaration 'main'
3. C:\Users\jbatista\Desktop\hlsl.hlsl:3:6: Generating code for declaration 'main'
Exception Code: 0xC000001D
```

This failure is reproduced with this minimal shader:
```
[numthreads(4,1,1)]
void main(uint16_t3 TID : SV_GroupThreadID) {
  uint OutIdx = TID.x * 3;
}
```
Note that the parameter type for `TID`, `uint16_t3`, should really be a 32 bit integer, or an i32. Because it isn't, there's a mismatch when it's compared against the attribute's expected result type. i16 != i32.
Compilation args: -enable-16bit-types -T cs_6_5
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJycVU1v2zgQ_TX0ZRCBoiw5Ovig2EnXQHZbNN5cA4ocS2wpUuBH4vz7BSm3abLYPVSwJQ41nDccznvi3qvBIG5JfUPq_YrHMFq37W1_TVtar3orX7fHEUHYaVYaHQjH_YgeXlQYgRvg3qMLyho4caWjQ1J1hHakoZcf7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