<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/81543>81543</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
interrupt useless cld
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
gooncreeper
</td>
</tr>
</table>
<pre>
Example code:
```C
__attribute__((interrupt))
void isr(void*_) {
return;
}
```
Generated ASM:
``` ASM
isr: # @isr
cld
iretq
```
Ideally, and as generated by gcc
```ASM
isr:
iretq
```
Clearing the direction flag should only be emitted if
1. We are using string operations
2. We are calling another function
IRETQ will revert the state of RFLAGS
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMkk1vnDwQxz_NcBllZQYIcOCwedko0vMcmlTqcWXwLLjy2tQ2SffbV4YobdMeiixgXv8_yX8Zgh4tcwfVDVR3mVzi5Hw3OmcHzzyzz3qnLt39d3meDePgFEOxB3EHYg_XYju3W3w8yhi97pfIxyNQA9RoG9n7ZY5AbTpr34vTCnXwQE36BdofgVqE-maro-e4eAvFWwz13QfBLXxgy15GVrh__v9PqjW7ppJWsUegAqEUKdp03p7BqN8T2nP89lfJR8XSmAvQLUqrUAYc3yH6C47D8GHsA8O_6mzvW8PSaztinBiV9jxE7SyejBwxTG4xCp01F-wZ-axjgtCnbTTf4RdG6RmXkDaEuC5yc4LVzoatjd7bBmlM6pDWxYk9nha7qv3K8_h0__kTvmpj0PML-7iChSgjozvh0-G__cNzprpCtUUrM-7yWtR1XbV5k01d04q-kXXfcDkMjWirQhTl0DayZXVSSma6I0GloJyI8ryqd4r7VhbUUlUVos6voRR8ltrsjHk575wfMx3Cwl2TV2WRGdmzCauTiSy_4loEomRs36WZq34ZA5TC6BDDzy1RR8Pdu1dxCWw4hGSMbPGmm2KcQ7o9OgAdRh2npd8N7gx0SDvePlezd195iECHVTkAHVayHwEAAP__LawBkw">