<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/85268>85268</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
missed fold, sext(fptosi x to i32) => fptosi x to i64
</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>
zhengyang92
</td>
</tr>
</table>
<pre>
https://alive2.llvm.org/ce/z/bFW9vZ
online Alive timed out for this one, you'll need local alive2 with larger smt-to.
```llvm
define i64 @src(float %0) {
if.end27:
%1 = fptosi float %0 to i32
%2 = sext i32 %1 to i64
ret i64 %2
sink: ; No predecessors!
unreachable
}
define i64 @tgt(float %0) {
if.end27:
%1 = fptosi float %0 to i64
ret i64 %1
sink: ; No predecessors!
unreachable
}
```
no brainer, same pattern applies to fptoui.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysU8uOnDAQ_Jrm0pqRafMYDhxmd8Ix10i5GWjAibGRbTa7-_URsM8ox5UQSHZVdxVdrULQo2WuIb-D_JaoNU7O188T2_FJ2bGipHX9Uz3FuASQV6AGqFFGPzCdjXmYz86PQE3HQM0zUNM2P6qHnyBuIK7OGm0Zrxsao565R7dGHJzHOOmAzjLQPT65Fag0Bi1zj8Z1yuDRAf_oOKFRfmSPYY6n6M5H6Zd3IY5nU3Ic9TxsPXWRIWQi-A7oMhinIgLlAqhCKO8OqB7ObHsqN1tHOcpTBHnDYYkuaHznYXSoJb3BaIcFfozbMe7EDVJkB8RzPCRQTh8FB21_g7wiyDv87nDx3HPHITgfgNIDs1rPqptUa_iFWt4-1vjsMI7x6xz-R376hfJfp_WxpHXYeqUt-y0KQc2Mi4qRvUW1LEZz2JRtcld9Tvpa9pWsVMJ1WqYik4VIZTLVl6rvlVKXohRK5CInLgumNK2ozGTVD4muSVAmZJqlpShyec55aEVVprmqmFrZQSZ4Vtq8hTrRIaxcX3IqLolRLZuwLwnRHjZ51TbEzs2t3lJMQPdANOsQuD-5JepZP6uond3u8lvi6412atcxQCaMDjG8t4o6Gq4PMg7O9Pu_4Md9tMekHl8juM1X3kB-w083RZas3vyzp6OO09qeOzcDNbvs43NavPvFXQRqdpcBqNmN_g0AAP__SZ0z5g">