[llvm] [InstCombine] Canonicalize `(sitofp x)` -> `(uitofp x)` if `x >= 0` (PR #82404)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 7 08:53:40 PST 2024
goldsteinn wrote:
> Regression:
>
> ```
> define float @src(i32 %shr.i) {
> %and.i = and i32 %shr.i, 32767
> %sub = uitofp i32 %and.i to float
> %add = fadd float %sub, -16383.0
> ret float %add
> }
>
> define float @tgt(i32 %shr.i) {
> %and.i = and i32 %shr.i, 32767
> %addconv = add nsw i32 %and.i, -16383
> %sub = sitofp i32 %addconv to float
> ret float %sub
> }
> ```
>
> Alive2: https://alive2.llvm.org/ce/z/W6Ik5C
Is that a regression?
Seems like the `fadd` -> `add` is desirable.
Likewise we don't really know return op sign in either.
https://github.com/llvm/llvm-project/pull/82404
More information about the llvm-commits
mailing list