<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/88239>88239</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Loop Vectorizer] Loop Vectorized with Gather Instead of Load Due to SUB => XOR Transformation
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
mmarjieh
</td>
</tr>
</table>
<pre>
Starting from Clang 18, I get a masked_gather instead of regular load in vectorizer.
Reproducer:
https://godbolt.org/z/zeh1WK7qY
I believe that the issue is happening due to instcombine transforming SUB -> XOR. Does it load unscevable pattern?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxckk9vnDAQxT-NuYyCjGFjOHBoQqlWjVQp6d9TZfAATo1N7WGj5tNXsNsm7cFjeSyP3ns_qxjN6BBrdrhhhyZRK00-1POswqPBKem8_lU_kApk3AhD8DPcWuVGyEombuEIIxIomFX8gfr7qGjCAMZFQqXBDxBwXK0KYL3SYBycsCcfzDOGlPGG8Tfneo9L8HrtMbD80pqIlridRMtEO3rdeUupDyMT7fO2cMq-vJc_v72ec4QOrcETAk2KgCYEE-O6VZjUsqDbbOgVgfwus_dzZxwCBeXi4MO83T98uoErlr-Frx_uU2g8RjB0trC62ONJdRZhUUQYHMvb1woSXee6yiuVYJ3JTMi8KDlPpprjUA6ykKWQqs-KUl9zeY2ZlMj7YdBFYmrBRcGLjHNZcM7TqpRd3_fikPNKVkPGCo6zMja19jRvSSS7t7osRV4lVnVo485RCIdPZ-NMiA1rqLc3V906RlZwayLFlylkyO4f4M77BT7_JcQODfzb0vBkaIJ3Z8zHF8x3WzbNOdYtPZY3l_zg459kFRnvkjXY-j-0hqa1S3s_M9Fuoi7b1RL8I_bERLtbiUy0u9XfAQAA__8xhOBH">