<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/75956>75956</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[libc] LIBC_INLINE_ASM pessimizes asm statements that are not implicitly volatile
</td>
</tr>
<tr>
<th>Labels</th>
<td>
libc
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
nickdesaulniers
</td>
</tr>
</table>
<pre>
why do we have LIBC_INLINE_ASM? Throwing volatile on every asm is a pessimization. It generally prevents CSE which is bad.
> asm statements that have no output operands and asm goto statements, are implicitly volatile.
https://gcc.gnu.org/onlinedocs/gcc/Extended-Asm.html#Volatile
We're pretty inconsistent in our use of `asm` vs `__asm__` (and same with `__volatile__`). We should clean all that up and just use `asm` then explicitly mark cases where we need `volatile`.
Putting volatile around everything is great for avoiding compiler bugs from 20 year old compilers, which we don't support.
Putting __ prefix+suffix also doesn't seem necessary.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxsU02Pm0gQ_TXNpTQIN8bYBw7zZWmkbLRSVpujVYYCOmm6UVe1Pd5fv2rsTDKjuYCo7_d4D5nN4IgaVT2o6inDKKMPjTPtz44Yo3WGAmdH312a83iBzsOZYMQTwZeXh8fDy9cvL1-fD_ff_lLlHv4Zgz8bN8DJWxRjCbwDOlG4APIEhgFhJmYzmf9QjHc5vAgM5CigtReYA53ICcPjt2c4j6YdU88Ru1wVT6q4vz3L52UcCwpNS72MKNernAcfZY4CfqaArmNA1y31gxf_R5PSj4CBwEyzNa0Re3k7-926UWRmVd4rvVd6P7RtPriY-zAovffOGkedb_maUnr__CrkOuru7nnKR5ms0uW_t7l_jv1OSteBEmaRCxjXeseGhZyAceBjgMgEvge1KZAntSngxOnjcECeDocUUHqb0DFOBGcj4zX9C8ZSo_QuB_hOwKOPtoPWEjpAa6-kxXnh50dkWfb9XiYjOaDXN3ImDD-hRSaG80iBkhAcUZdafm1Um-Idd39HkXd6wOCj666akDGlDMMQCAV6HwBP3nQp2vppNpYCHOPA0Ac_gS7gQhjAJxC39PITr0I5E3TeKV0LcJxnH-TTSw6HxHhvXpV-4Nj35hXQsofOE9-6iSZw1BIzhkuedU3Z7codZtSs6qIsinqz09nYtCX1my1Vm_qIdVtuy7JaU9XX67ZalVRsMtPoQpcrvdqt6vWqLPLtVm9xXRQ7rPut7mu1LmhCY3NrT1NSVGaYIzV1tas2mcUjWV6MqbU1x1ZpnSwamlR-l4hR68IaFv49QIzYxcxLQ_X00aVv9iP-1EPJEM7LZ6bIYrDNBzMYGeMxb_2k9D7dcHvdzcH_oFaU3i-IkjsWUP8HAAD__0nYe3U">