<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/124255>124255</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
LLVM ERROR: Don't know how to widen the operands for `INSERT_SUBVECTOR`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
backend:X86,
crash-on-valid,
llvm:SelectionDAG
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
abhishek-kaushik22
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
abhishek-kaushik22
</td>
</tr>
</table>
<pre>
```llvm
define <8 x i32> @foo(<8 x i32> %a, <2 x i32> %b) {
%result = tail call <8 x i32> @llvm.vector.insert.v8i32.v2i32(<8 x i32> %a, <2 x i32> %b, i64 0)
ret <8 x i32> %result
}
```
https://godbolt.org/z/x6qnfPM7W
We get a fatal error in `DAGTypeLegalizer::WidenVecOp_INSERT_SUBVECTOR` for this seemingly simple code.
I'm not sure how this could be fixed. Can we just replace the `INSERT_SUBVECTOR` with a series of `INSERT_VECTOR_ELT` nodes?
There's also #102016 for AArch that also looks like the same problem as this one.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUU9tu4zgM_RrmhYghU74kD35wcxkM0Nku0my7b4Vs07EmipWV5KSdr1847uylMy8DGL6QxzqHh6TyXh965gLSOyBSVad9x8f5UQ2-00ciIIJ0PVND6KwrfszPKtu8FZCJ6TLmcgJRNtzqnhHkaoGvqCWB3CAkorUWaPEhTKkCWo1g-l-0Aloi5HcgShy_HfvBBAS5xqC0wVoZ8yPFqCC6cB2si3Tv2YXostCSoguNoF9hX6HOEhRAy5sEx-Ej3XdRIErI1-P9uxHjuyi7EM4eZAm0BdoebFNZEyLrDkDbb0Db1-yvvv39S_48wZ8ZDxxQYauCMsjOWYe6R8jEuvy0fzvzPR-U0d_YjYfK8lk33D9x_XB--fzb42a3f3n84-5ps9o_7CAT2FqHodMePfNJ9wfzhl6fzoaxtg1HIMrPQPkJexvQD46xs9fph9oOpsGKsdWv3ES4Uj1eGb8OPqDjs1E1Y-h4VPYz4qsOHSr07DR7tO1_cBPoZXO_H4G9bdiD3E717zt2DJR7VMZbBJKxIBFnt0LK0tUdhk6FKWusPXo0-jgp8erEeHa2MnxC5acybM_RrClks5RLNeMizmWex-kiiWddkS8bUcecpZQsVFNTnnAcJ20lpUwW2VLMdEGCUhFTEotUJHHUcqtqUbOqVJIukxYSwSelTXQbOusOM-39wEVMCaXpzKiKjX9frUrVR-4bkOWfi2zcKloBUe2U7-a2n1-U0c0_4dsayfKRDddB235dfnpfRFeMuXk1HPw47NoH_y970MFwcX__9AU3u93DDmSJa9sD5QGPvb1O_bV4Hcfm5po9s1N9428O_7yZs8GZ4sMg69ANVVTbE9D2pnV6zM_OfuU6AG1vRnig7bsXl4L-DgAA__8isVWH">