<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/144614>144614</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[WebAssembly] Degenerate case in vectorization of all true
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
badumbatish
</td>
</tr>
</table>
<pre>
I'm investigating #50142, trying to reduce any_true to all_true , reproducible example code gives this [godbolt](https://godbolt.org/z/oze7dosYo):
```c
#include <stdint.h>
int all_true(uint8_t *a) {
int8_t r = 1;
for (int i = 0 ; i < 16 ; i++) {
r &= !!a[i];
}
return r;
}
```
I changed `int8_t r = 1` to `int8_t r= 0`, and `r &= !!a[i]` to `r |= !!a[i]` and the code degenerates completely (not even vectorized as any_true or all_true).
The godbolt link is [here](https://godbolt.org/z/qcMPj1be9)
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyMU8uu4zYM_Rp6Q0xgUX4uvMijAWZRoIsCRVcDWebYmipSKslpc7--kJPmXgxaYAwBlnh0KPKQVDGa2TEPUB-gPhVqTYsPw6im9TKqZOJSjH66D5-B2gsad-OYzKyScTMCyboUFQEdMYV7NiWPgadVMyp3_5LCytmkrH3s883A1-CnVZvRMvLf6nK1jNpPjLO5ccS0mIhQH2Y_jd4mqE9A3ZLSNYLcA52Bzk9o58MMdH4DOvs3bicff_dAfb5W7qEpH0vnA0njtF0nRpDHmCbj0m4B-VPGyr1x6RUjULcal7ovCYH2CqhHaA9Q7hERn0BAkCcUIP-1f_UBgbrsx2xYiSAP2_6IonkcgA7b-ugwf5naZBKQABIK6oPJWb-8Q3t67gKnNTgMD-xhfyX6yOUz6kW5mSeEpvwu3qbM1fhg30LNVDqichvl_6J5cQNCe_zvC9lFWp7VnHhmx0Eljqh9rnJie88yOZ-Qb-zwxjr5YN54QhXfO8aHD9Xod4-8fl0Yn3VHa9wf-OiShQP_WIv8qX_-5ZsYuQfqi2mQUy97VfAg2roUfd_2fbEMsqWqY6XrtiHWXaU6KZTuGpqkIFH2hRmopLpsREskG9nvRCe14LFpm6ora9VDVfJFGbuz9nbJzxcmxpUHUVWNqAqrRrZxmzYix3_hhgJRHr4wZNKncZ0jVKU1McV3N8kku43pbzzuY-TLaO9Qn_D00hm1iozmXVeVjHfov2Y5MctZrMEO3wll0rKOO-0vQOf82PP36Rr8N9YJ6LyFGIHOzxxuA_0TAAD__1nSQU4">