#206927 introduces a miscompilation: https://alive2.llvm.org/ce/z/jpkAUn
The patch infers frexp's exponent upper bound as ilogb(K) from fabs(x) <= K, but for K = 1.0, the valid boundary input x = 1.0 has frexp exponent 1 rather than 0, causing InstCombine to incorrectly fold e <= 0 to true.
For more details, please refer to https://archer.top/pr/206927
cc @arsenm
Found with Archer. Please let me know if anything is wrong.
#206927 introduces a miscompilation: https://alive2.llvm.org/ce/z/jpkAUn
The patch infers
frexp's exponent upper bound asilogb(K)fromfabs(x) <= K, but forK = 1.0, the valid boundary inputx = 1.0hasfrexpexponent 1 rather than 0, causing InstCombine to incorrectly folde <= 0to true.For more details, please refer to https://archer.top/pr/206927
cc @arsenm