<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/59489>59489</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Aarch64 bizarre codegen
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
moon-chilled
</td>
</tr>
</table>
<pre>
Apologies for the vague title; not being an llvm developer, it's not quite clear to me how to characterise the problem. [Compiler explorer](https://godbolt.org/z/ndhE4e31z) link. The following code:
```c
#include <arm_neon.h>
static int movemask(int8x16_t a) {
a = vshrq_n_s8(a, 7);
unsigned long long lo = vgetq_lane_u64(a, 0), hi = vgetq_lane_u64(a, 1);
lo = ((__uint128_t)lo * 0x0103070f1f3f8000ull) >> 64;
hi = ((__uint128_t)hi * 0x0103070f1f3f8000ull) >> 64;
return lo | (hi << 4);
}
int f(int8x16_t a, int8x16_t b) {
int x = movemask(a);
int y = movemask(b);
return x | (y << 16);
}
```
Generates reasonable code for 'f' in llvm 13 and earlier; in 14 and later, it turns into a hot mess. Putting a blinder in front of either of x and y appears to rectify the issue.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVE2P4ygQ_TWVS6kjDP48-NCddPa6h71b2C7b7GBwA84k_etXuBNNNttaaaSIgHn16hXFQ3qvRkNUQ_YG2XEn1zBZV8_WmpduUlpTv2ttf61fF6vtqMjjYB2GifAsx5UwqKAJxBsaG7AlZUaUBrU-z9jTmbRdyAE_oArAC7-hPlYVCDtN0mGwOBNO9mecdZN0sgvklKctxeJsq2neI0L2drDzojQ5pMuirSMH2RF4OYWweBCvwE_AT6PtW6vD3roR-OkT-Mn003tKIvkEXqFW5sce8a-JcLBa259Rb2d7igTsCOw-5uzr193WXCjT6bUnBHGQbm4MWbOfQLw_hvkgg-pQmYCzPdMs_Q_gpTKhvCR5E1BGDVC8faERESWCOOLZT-6jMY0vgZcyHlcBvALxAFzN1qgetTXjffgKHil8NFoaatY8vROwSMAPOKn_ASXPWW6UwKOQplmVCQkvmwC8ilv8FdmFJUywgg3JIIaSMbZqvZUl3kG8Y57-i_CW_jvCuPX7hI7C6swmtDhE3i3DAcQB08dqoDg-dia2ZHjuxQF_Ldv_tCaGXDb1D72UzycWUddnVPuMuqm-3EVf75qT_HvR9_v3WMMfZMjJQB4dSW-NbDVtl3ezJPBiAF6gurkvEShNjySdVuSiQ5XBJN0-ahnursQozMcyLEqcbMCZvN8j_rmGsLkZW61MTy7GD86agHZAUmEiF2eXjfGKcllIOh997KgLarhuFlber7Tf9bXoK1HJHdVJXrCKJ2WV76Y67bKu7NI8G4q-Lft2ECztq6zL0yEf8pzvVM0Z5wlPBCuzMsn3ieC9zNOO8VwObTpAymiWSu9j1dH3uy1lnVVpWe20bEn7--vm6gh6adfRQ8q08sH_CttesvpVum7KU2zVp3Tu63xHMrvV6frpqVFhWtt9Z2fgp8hy-3tZnP2bugD8tCnxwE-bmH8CAAD__wCDnFc">