<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/99746>99746</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Convert scmp/ucmp idioms into intrinsic call
</td>
</tr>
<tr>
<th>Labels</th>
<td>
llvm:instcombine,
missed-optimization
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
dtcxzyw
</td>
</tr>
</table>
<pre>
Alive2: https://alive2.llvm.org/ce/z/Q2ogeM
```
define i8 @src(i8 %x, i8 %y) {
%8 = icmp ult i8 %x, %y
%9 = icmp ne i8 %x, %y
%..i.i = zext i1 %9 to i8
%.0.i.i = select i1 %8, i8 -1, i8 %..i.i
ret i8 %.0.i.i
}
define i8 @tgt(i8 %x, i8 %y) {
%ucmp = call i8 @llvm.ucmp.i8(i8 %x, i8 %y)
ret i8 %ucmp
}
```
cc @Poseydon42
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMU8GOmzAQ_ZrhYgU5AwQ4-JDdiFul9hPAniVTGRxhk27y9ZWB3ex2W6lSFMz4vZk3b4bWe-5HIgXFExSnpJ3D2U3KBP16v_1KOmdu6mj5SgjZUZxDuHjIjoANYNMu8dTa65C6qQdsNAE2d8DmB7qevoE8gTzCQW6_5dXQC48kuBKQSz9pwCqesXgFfBbr8QZYCyifVoaIoUpAdhKsh4uYbRAfKAv-AawfwK3M33Fpyikv2Du9BsH7lRyc4OojTL7jPFnSb8hqU7vbP2QvKd-4E72pXFNsZpSn7fDVjNCH_zRjjt1FSbq1dmMvY4gXKVf_SvNVWyT8qezzvNZ_rWON787TzbgxR7GGE6MyU2d1m5Dal7jPD4dCZslZda3BjLo2zwuk4sVoXVOddUVXmn1dlZiwQom5LFHKWlaYpYRl15V5YQjpUB4KyCUNLdv3_UrY-5lUXZf5IbFtR9YvW4sYEZAdefRBu6HjkQAR8BkQB_aezM5dAg98bwO7Md4Vp2RSkbbr5t5H99gH_ygVOFhSz2680hSEjyZhs7jOht3gBY9xUcYw8ehZL3NI5smqz19Iz-E8d6l2A2CzqFwfu8vkfpIOgM3SlAds1r6uCn8HAAD__wWiAVU">