<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/90459>90459</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Redundant load is not removed around memcpy
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
vladimirradosavljevic
</td>
</tr>
</table>
<pre>
In the following example:
```
#include <string.h>
int test(int *a, int *b) {
*a = 5;
memcpy(b, a, 16384);
return *b;
}
```
LLVM is not able to remove `*b` load, whereas GCC is able to do so, as it is shown [here](https://godbolt.org/z/Mchd4fo5f).
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsUkGPmzwQ_TXDZbQRjCHAgcNu8vGp0u6lh94NHsArY0e2Sbr99ZVJtq2qSgjMvHlvnp5HhqBny9xB9QLVOZNbXJzvrkYqvWrvpXJBXs07X_WYDU59dF8sxoVxcsa4m7Yz8ne5XgyDeIb8DPkzHPPHc_8loe1oNsUI4hSi13Y-LCD-e8D7W9uIkUMEatIR6FkCnfBxHoBahPrl3os7jCDOWIH4VVx5HS8fQM2QmDu9OIqmBGr_6PIcN2_vop9VqM__dI6vr9_eUAe0LqIcDGN06Hl1V8bUlDSOORonVZp2W9izDPj_6ZRInwTlMLjdUkAdExIWd7MI1UsiQHUGapYYLyElSD1QPzs1OBMPzs9A_Q-g_m1cVDm5agJqD5nqhGpFKzPuirooRVs0VGRLR7IqyrYRPHFTlIqn5tgqlpUsJy7qIc90RzmVeUltUVR1Xhwa0RzrUdT11MpJyQHKnFepzcGY65rmZzqEjbs2L6s2M3JgE_ZVIbJ8wx0EorQ5vkucp2GbA5S50SGG3ypRR8PdV1abVdLGPbPPZO-JKpTebVY97jHbvOn-SkXHZRsOo1uB-qT8-DxdvHvnMQL1u58A1O9-fwYAAP__T6Lb1Q">