<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=http://email.email.llvm.org/c/eJylU1mP0zAQ_jXJy2ijHD02D3koXQErWIGAP-Bjkhh8VB6npf31TFKWLccbUhJ7Ys98h8cy6HP3ZcSIQIiOIAWQCIdAZKRFEEBOWAvoR-EVOvQJ-hDBhhNG4wdw6NThDGkUCQyBiigSaghTgtBzug3hAPIM73l81Ca4Ah4T0Bgmq2cko7mkUcLOyGlECB6v1U6C4BRNSujBCT8xjTMYf90UzWA8J6mgsYC3zOaIMav3YBJo0_cYOXnkTDS8P8LdB-IkHi4zy0NEYtgCsvIhK3fX72dkuZzwXbiDxeu_MaUDZc0uq1_zMwQtg01FiANHF36ravPUfvTv2ttCrM-J8yxOgBTqG3rNiIHtdHBiOgsZiUpMhC--gGLwiCoM3lxw1rFoZSOUIJylSfaUf_fC2OWcdLiu91dhxS2HN_v9jKknhbQ4RsLh4tayfc4rct01um1akYspjSF2R03cCDqfou3-UM60J1mo4Diw9vg83DHGV1SJQ0M0IfFk3azu63zs1m2F2163Za2VEvetWOmVlCsl-m3VSuxzKyRa6rL1q2z9kP8_pOnqsq7Lqm6rqt6sN8W2UbKqyqZUqJpKr7NViY7dK-Y68ynmsVtKymkgXrSGEr0sCr4Dg0d8ZphMskuw-_TE8TzZRTVuVhzAjgid5A6d7f15KW4vwz9uwq9G7SMHf_U-H_9vbZ4vcrtF6w_stT67>53482</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[ARM][AArch64] Assembly for memcpy created out a loop by LoopIdiom differs from the one that was in original code
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
vdsered
</td>
</tr>
</table>
<pre>
There seems to be possible a small enhancement for lowering memcpy that is created out of a loop by LoopIdiom. It should be identical to the one that was written manually in the original code. However, it differs when either -Os or -Oz is present.
See an example
https://godbolt.org/z/116M9PnK9
It may be a backend problem with -Os because LoopIdiom can recognize it in that case, but it fails to do that for -Oz.
GCC produces the same code for that.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxtU9mO0zAU_Zrk5WqiLE06fchD6QgYwQgE_ICXm8TgJbKdlvbruU6ZmbJISewb-_ieReZOnvtvE3qEgGgCRAccYXYhKK4RGATDtAa0E7MCDdoIg_Og3Qm9siMYNGI-Q5xYBBVAeGQRJbglghsIrp2bgZ_hI42PUjlTwGOEMLlFy9RJSTpSCaZT5zghOIvX004swMmrGNGCYXYhGmdQ9rrJq1FZAgknsYD3xOaIPqsPoCJINQzoCTwREhXt93D3KRCIhktiOXsM1LaArHzIyv31-xVJLgF-MjNrvP6bYpxD1uyz-i09o5Pc6Vg4P1J1obequqfdZ_thd3sQ6TPsnMQx4Ez8QCupoyM7DZyIzkqGo2BLwFdfQFBzj8KNVl0w6Vi1khGCBUzSOHlKvwem9JqTdNf14SqsuOXw7nBIPeUiMKyOBWZwdWvdnnBFLvtG7pody6OKGvusfbP_8pS1D2my92LqNlTAPgQ0nLxPwN9x38b8n4xfIhg8Ff-kSsL-CDBfvO7_spp8WnghnKFC6-PzcEeivqOIVKoQFgw0aZvNfZ1PfTlsOGNcYtNV1bZtEe9FW27rodvWTSm7XDOOOiSdpCtXfV3WdVnVu6qqu7Yrto3gVVU2pUDRVLLNNiUaMrtIjVPoue9XDnwZAy1qFWJ4XWR0ZUaL-Hw-W-LkfH-UgW6XzFe6_cr1F8taKEc">