<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/62036>62036</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
llvm::Loop::getLatchCmpInst fails when branch instruction condition is fcmp instead of icmp
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
soconne
</td>
</tr>
</table>
<pre>
Is it expected for llvm::Loop::getLatchCmpInst() to return null instead of a valid llvm::CmpInst instance for cases where a branch instruction's condition comes from an fcmp instead of icmp? Currently the API is hardcoded for icmp and returns null for fcmp due to the llvm::dyn_cast call.
https://github.com/llvm/llvm-project/blob/main/llvm/lib/Analysis/LoopInfo.cpp#L178
Would refactoring this to llvm::CmpInst break anything?
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUUsGO2yAQ_Rp8GTXC4E3sgw_prixF2kNvPVYDjG1aDBbg3ebvK5xIG6l7aC82MG9m3pt5mJKdPFHPnr6yp5cKtzyH2Kegg_dUqWCu_SWBzUC_V9KZDIwhgnNvC5NnJs-vIay300T5FbOen5f14lNmomWigxwgUt6iB785B9anTGggjIDwhs6ah1r3zB2EXtPeSmOiBO8zRQIEFdHreUfETWcbPBOnBDp4Y8sNdFgowRjDAuhh1Mv62NPqZWVyAHjeYiSf3RXyTHD-dgGbYMZodDB3jQUL6M2df7oJKJG9qtmoiCvpHwrM1f_QmDJodO7A-Avj5znnNZWwGJgYJpvnTR10WJgY9sTb78saw0_SmYlBuaCYGBa0_gFjy9vZo7smm5gYyuAvfgwHva5MyNf61N763b7fw-YK9RF1DtH6CfJsU2H897xVJPwF6K95tn5icqhML00nO6yor49tzTvZdrKae4MdP3JTc1KNonFs2lZQrdsTmrrFY1fZXnAheVNzLmQt5UHJ8SRGLYjkqcEnxRpOC1p3KDQOIU6VTWmj_ii4PFYOFbm0m1EIT--wB5kQxZux3weltimxhjubcvqokm121P-DL2FE63ZD-U_c9OAkmz61T7VF1__3TncdZW27zj8BAAD__yHZKRo">