Skip to content

[ValueTracking] Off-by-one in frexp exponent range inferred from dominating bounds #208192

Description

@cardigan1008

#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.

Metadata

Metadata

Assignees

No one assigned

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions