Skip to content

[InstCombine] Missed fold: icmp(fptosi(x), c) -> fcmp(x,c) #188629

@zhengyang92

Description

@zhengyang92
define i1 @src(float %x) {
entry:
    %n0 = fptosi float %x to i32
    %r = icmp eq i32 %n0, -1000000000
    ret i1 %r
}
define i1 @tgt(float %x) {
entry:
    %r = fcmp oeq float %x, -1.000000e+09
    ret i1 %r
}

Alive proof: https://alive2.llvm.org/ce/z/Zkm4CJ

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions