<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/57599>57599</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
IPSCCP and LibCallSimplifier
</td>
</tr>
<tr>
<th>Labels</th>
<td>
llvm:optimizations,
missed-optimization
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
nickdesaulniers
</td>
</tr>
</table>
<pre>
An interesting (perhaps) case from the Linux kernel:
https://lore.kernel.org/llvm/20220905003732.752-2-mailhol.vincent@wanadoo.fr/
So it looks like IPSCCP sinks constants into `ffs`, dead arg elimination removes the argument, then `LibCallSimplifier::optimizeFFS` fails to optimize this case.
Maybe IPSCCP should be trying to match such functions BEFORE sinking constants?
cc @fhahn @efriedma-quic @davidbolvansky
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJxlUtuOmzAQ_Rp4sYKICVAeeMhmN1KlrbpqvmCwx-DG2Klt0qZf3zG73YtWQjaeGR-fc2YGJ2_93jJtI3oMUduRZfzLBf0El5DxjgkIyJR3M4sTskdtlz_sjN6iyap9Vt5n5X6KkWrpxI_0GeexeK4onB9TxFxn2njJedmVdVlWbcWLtuYbvplBm8mZ4qqtQBuzXfkbLEjnCuUT3vrA83pyTEdmnDsHZvQZ2den0-HwxIK2FBHOhgg2hqTFsawplQq0ZvzAJIJk4EeGRs_aQtTOMo-zu2JYZVFumdPzVExnm64_6uEAxpz0fDFaafRJYbV3l0gYf_F4PFERU8SfMBz7H6f7OqyuFe_Jf4Pb8MZ4couRjALR35LldH-GKCYWFlrUYkWiGNjdw_H7j4dVYSp71ZhVH5wRgpFxaoLJph9UXqOcYfNr0WtGwlXLwZkr2HC-sRz7bdPwuuK8a3LZV7KrOsijjgb7F4pgJfvkQL5403_s9qjjtAyFcPNbo9O2uXj3EwU5etQhLEizdKzbuuvyqecSUIEQrVS85bhtRbnruKqhUw20TZ0bGNCEPqvvMs5X0Fff194RGE-tom0mdJSb99mUrO9z3b8MXFs21bZqilaVWDew47utFNtaJafS-BXphTSque9X6sMyBkoaHWJ4S0IIerSIKy3ChyVOzvdWi7PEAIux5FDIV7X9KvUf9nUY9g">