[llvm] Reland "[ValueTracking] Compute knownbits from known fp classes" (PR #92084)

Jay Foad via llvm-commits llvm-commits at lists.llvm.org
Thu May 16 02:01:35 PDT 2024


jayfoad wrote:

> Reduced reproducer:
> 
> ```
> define i64 @test(double %x) {
>   %cmp = fcmp uno double %x, 0.000000e+00
>   br i1 %cmp, label %if.then1, label %if.else
> 
> if.then1:
>   br i1 %cmp, label %if.else, label %if.then2
> 
> if.then2:
>   %cast = bitcast double %x to i64
>   %and = and i64 %cast, 1
>   ret i64 %and
> 
> if.else:
>   ret i64 0
> }
> ```

So `if.then2` is dead code. It seems perfectly natural to me that you can get conflicting KnownBits info in dead code, and we should handle it instead of asserting. Treating it as poison sounds good to me.

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


More information about the llvm-commits mailing list