<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/100045>100045</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
aarch64: constant with orn is not using the same trick as bic
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
pinskia
</td>
</tr>
</table>
<pre>
Take:
```
int bic_cst(int a, int c)
{
int b = 4 & ~c;
return b;
}
int orn_cst(int a, int c)
{
int b = 4 | ~c;
return b;
}
```
Currently bic_cst produces a constant move followed by a `bic` instruction. But orn_cst does not do the same trick for orn instruction and instead has a mvn followed by orr.
Noticed while getting GCC implementing the same trick for both (https://gcc.gnu.org/PR115086) and I thought I would report it here too.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJycUkFv2zwM_TXyhaihyLYcH3xoE-RDLx-GYfdBkhlbqywFEpWgl_32wU6WtkMPwwDDJkVT7z3yqZTs6BF71jyxZl-oTFOI_cn69GJVocPw2n9TL8iqR8b3jD8yyW_PmlpPoK35bhIxsV0yxcQOlsAw0d162qdrAGtBA6v2UAMTEn4aVt2LESlHD_p-xNr9LbiDhej_Dazd_TXYR4nX9y7HiJ7c62-5cIphyAYTKDDBJ1KeYA5nhGNwLlxwAP0KCpjk2homOVifKGZDNvgSnvJdCwwBE_iwBEATQlIzAkVrXuAY4vLb-15QflhzVANMasGfz_4DaoixfE_-_0DW4ACXyTqEEYmsH-G_3Q7sfHI4o18PPsHWgSZgYjsRndJiAnFg4jAaU44-lyGOTBy-fN1sGr6VTHQrt2egKeRxIniGS8hugIinEAkswYQRgUIoi6Gvhq7qVIH9phUb2TWNlMXUtxuNx0oezVApLdVGqUF1SnctF1sz1NvC9oKLmrei4ryWXJYNNtIc2063jdxWvGE1x1lZVzp3nheOhU0pY7_hnNdN4ZRGl1bDC-HxAmuVCbH4P_ZL04POY2I1dzZReruGLDnslYpmkjWrHt_2frE0Xfd0XWROn8xTpcU7RY6u_2OclqasSxNmJg4L2u3zcIrhBxpi4rByTEwcbiLOvfgVAAD__89kKNI">