[llvm] [InstCombine] Canonicalize `(uitofp x)` -> `(sitofp x)` if `x >= 0` (PR #82404)
via llvm-commits
llvm-commits at lists.llvm.org
Tue Feb 20 11:39:59 PST 2024
goldsteinn wrote:
> > My thinking was `sitofp` is a better canonicalization, but either way we should probably pick one.
>
> Why is it a better canonicalization? We prefer unsigned over signed operations for everything else (zext, lshr, udiv, icmp u), so this would be a very unusual.
There seems to be a lot more support for looking through `sitofp` than `uitofp` (infact saw no cases where we support `uitofp` but not `sitofp` in `InstCombinAddSub`/`InstCombineMulDiv`.
Also fp types are pretty inherently signed, so think signed -> signed as more intuitive/direct.
https://github.com/llvm/llvm-project/pull/82404
More information about the llvm-commits
mailing list