<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/137447>137447</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[AArch64] codegen for vector init
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
k-arrows
</td>
</tr>
</table>
<pre>
Consider the following two functions:
https://godbolt.org/z/a9az3h6oq
```c
#include <arm_neon.h>
int8x16_t f(int8_t x)
{
return (int8x16_t) { x, 0, x, 1, x, 2, x, 3,
x, 4, x, 5, x, 6, x, 7 };
}
int8x16_t g(int8_t x)
{
return (int8x16_t) { 0, x, 1, x, 2, x, 3, x,
4, x, 5, x, 6, x, 7, x };
}
```
The difference between functions `f` and `g` is only in the parity of the indices, so the assembler output for both functions should be similar.
This issue is motivated by the program in GCC testsuite:
https://github.com/gcc-mirror/gcc/blob/master/gcc/testsuite/gcc.target/aarch64/vec-init-20.c
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyclN2SoyoQx58Gb7piEfyKF17k43he4NxPIbTKWYQsYDKZp9-CzCRbu1M7VWtZ-m9ou380jdx7NRnEjlQHUp0yvobZuu7bhjtnrz4brLx1R2u8kuggzAij1dpelZkgXC2MqxFBWeNJsSd0P4dwTpL1hPWTlYPVIbduIqx_I6znLX8r5tp-J3RPanq_RTRYoYzQq0QgxZG75cWgNflMin_iLN0rE3av2_olwEjYLlovAV4Ja-N0cyB0D-AwrM7A-3zyJqwF0hyi5xFofCS1fSj2UAVhxxTm0yu5lA_n6qHqh2qANCdSHBLR6Vfs6W-wvyZOKob5gi2p3wA_tuAO-9-MINU4okMjEAYMV0Tz3GMgNR1JTYEbGfUUtfJgjb6BMqk9ztypcAM7JksZqQT6mNzbNMK9x2XQ6MCu4bwGGK2DwYb5pzR-tquWMCB4tSjNXf7Bpzwo71eMWRcb1IUHlDDc7qmdnRxfIsm_xyME9MGvKuCnranCvA65sEs0hNgsyjnr7gZh_aDtQFi_cB_wOfoMmUbywN2EIfY1d2KuS8L6C4qNMipsGM1FJrtCtkXLM-y2TVnVVUObXTZ3tJEFFpKyYayLqq5GOraS7aqa1yOrBpGpjlFW0ZLVdFeWRZPLLd22NW-GdkSKBSclxYUrnWt9WeIJy1Jhum3RlGWTaT6g9ulUM2bwei8bYSwectfFjzbDOnlSUq188M8wQQWdfgf7_X1N1QmElTjFTrAOLiiCdRDXmK1Od3-oa4z5_tqcnf0fRaxVIvGE9e-ol479CAAA___BK1oo">