<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/133984>133984</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
MemcpyOpt doesn't strip TBAA correctly
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
gbaraldi
</td>
</tr>
</table>
<pre>
While debugging https://github.com/JuliaLang/julia/issues/57959. It got minimized to what looks to be a bug in MemCpyOpt, where it strips the noalias attribute of a memcpy https://github.com/llvm/llvm-project/blob/3c7a0e6c826b8bcfa4ec6154fd4247658ca3a03f/llvm/lib/Transforms/Scalar/MemCpyOptimizer.cpp#L1682-L1688 but not the other aliasing metadatas (tbaa,tbaa.struct). Probably using `combineMetadata` as used elsewhere in the pass
@khei4 was the one that originally added this optimization
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUkkFv5CgQhX8NvpRiYcBu--BDJytLu0qUlTbSnguotkmwsQAn6v31KzudzJxGmgtFHR7Ue_VhSm5ciHpW37P6jwK3PIXYjxojeusKHey1_3dynsCS3sbRLSNMOa-JyTMTAxPD6PK06dKEmYnhr807fMRlZGJ43e9MDC6ljRITQ33q6q6EPzOMIcPsFje7_8hCDvAxYQYfwlvaO02AoLcR3AJPND-s1-c1M_EAHxNFApch5ejWBHkiWAJ6hwkw5-j0lgnCBRBmms16_dWs3r9_lbs1hlcymYlB-6CZGKQ5IafGtKLRrTYXVGSaqlYXq4Q6NXVrUCKXl5_ecbvuJeKSLiHOu-F_DHqMTAzfJg7HsTTryoR8rJpW3O1nC3rLsIR8OAp5ogiHqz3umTJazJiAiTZrRCYe9lKmHLd95q6Ev2PQqP0VtkPCGm7CrN1CTzcxazhggi2RBfKJbkkux4crpsT4mSn-NpFT8IGf0YaFIO-bCdGNbkHvr4DW7iubXILw6QezC0the2k72WFBfXVSslacn5pi2hutat01XCptjVSmOVV11WlJvNGaF64XXNRc8UpwVVVNaWTd1ry2xmortSSmOM3ofLkHXYY4FgdRfSVl16rCoyafvgCO_bFPvY2JKe5dyumHLrvsqX86yHheM9hAaWHidOMJXu7PZzAhRjLZX4st-v63-fmm_Tbeey_-DwAA__-kkSBM">