[llvm] [InstCombine] Optimize unneeded float to int cast when icmp (PR #155501)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 7 06:38:22 PDT 2025


nikic wrote:

> * `icmp sgt (fptosi %x), <non-negative> -> fcmp oge %x, <non-negative + 1>`: https://alive2.llvm.org/ce/z/sdZTgm
> * `icmp slt (fptosi %x), <non-positive> -> fcmp ole %x, <non-positive - 1>:` https://alive2.llvm.org/ce/z/kwQv2U

It looks like these two have an additional pre-condition on the min/max value, but it doesn't seem to be checked in your implementation?

https://github.com/llvm/llvm-project/pull/155501


More information about the llvm-commits mailing list