Skip to content

missed FP fold, (x >= 0) ? x : -x == 0 => x == 0 #85250

Closed
@zhengyang92

Description

@zhengyang92

https://alive2.llvm.org/ce/z/NFEKjp
https://godbolt.org/z/7Ef9Kf4s3

define i1 @src(float %0) {
entry:
%1 = fcmp oge float %0, 0.000000e+00
%2 = fneg float %0
%3 = select i1 %1, float %0, float %2
%4 = fcmp oeq float %3, 0.000000e+00
ret i1 %4
}

define i1 @tgt(float %0) {
entry:
%oeq = fcmp oeq float %0, 0.000000e+00
ret i1 %oeq
}

@jayfoad @regehr

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions