<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/138212>138212</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
AArch64 float and bool code regression from LLVM 18
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
smeenai
</td>
</tr>
</table>
<pre>
We recently upgraded an internal codebase from LLVM 18 to LLVM 19 and observed regressions in several benchmarks. LLVM 20 and trunk exhibit the same regressions as well.
The simplest reduction demonstrating an issue is https://godbolt.org/z/hG3oh4sjY, where the code generated by Clang 19 seems strictly worse than the code generated by Clang 18. Clang trunk's code is larger than 18's (although smaller than 19's) but branchless, so I guess it could be better or worse depending on the input data.
https://godbolt.org/z/ns6rqhese is a more realistic reduction, which shows LLVM 18 generating code that takes advantage of vector instructions, which later versions fail to do. https://godbolt.org/z/e4q4E6xE7 is an intermediate simplification where 19's code seems strictly worse than 18's, with trunk's code being the largest but also having the fewest branches.
I bisected all these regressions from 18 to 19 to https://github.com/llvm/llvm-project/pull/84628. CC the diff author @YanWQ-monad and reviewers @goldsteinn, @dtcxzyw and @nikic.
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJyUVE2P2zYQ_TX0ZRBDoiVZPujgbuMiQHooUDTIcSiORWYp0uFQ9m5-fUHKyXYDtIteJALzgTfvvRlktpMnGkT7i2h_3eCSTIgDz0Qe7UYF_Tx8Iog0kk_uGZbLFFGTBvRgfaLo0cEYNClkgnMMM3z8-NfvUPeQwv15APQagmKKV9IQaYrEbINnsB6YrhTRgSI_mhnjI2_XOlmVuhQX_wj0ZKyyCZIhYJzpVRdkuJFzW1EdRXX8M6fY-eKIE0TSy5hs8KBpDp5TxGT9VOAzLwSWwaR0YbE7CnkS8jQFrYJL2xAnIU_fhDyZ33bBNPzls5APcDMUqcDIU8NEniIm0qCe4cGhn_K8TDQzcIp2zKTd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