[llvm] [SelectionDAG] Support sign tracking trough `{S|U}INT_TO_FP` (PR #82808)

via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 23 11:57:53 PST 2024


goldsteinn wrote:

> > Proofs: https://alive2.llvm.org/ce/z/RQYbdw
> 
> Shouldn't the proofs be more along the lines of this?
> 
> ```llvm
> define i1 @src_sitofp_i16(i16 %x) {
>   %xf = sitofp i16 %x to half
>   %bc = bitcast half %xf to i16
>   %r = icmp slt i16 %bc, 0
>   ret i1 %r
> }
> 
> define i1 @tgt_sitofp_i16(i16 %x) {
>   %r = icmp slt i16 %x, 0
>   ret i1 %r
> }
> ```
> 
> I assume computeKnownBits() on floats is still a bitwise interpretation, so it shouldn't use FP comparisons (not that it makes a difference here).

Good point: https://alive2.llvm.org/ce/z/VpChfv

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


More information about the llvm-commits mailing list