Skip to content

missed optimization, fptrunc (x) >= C1 => x >= C2 #85265

@zhengyang92

Description

@zhengyang92

https://alive2.llvm.org/ce/z/n53up6
https://godbolt.org/z/q6vrbxTo3

define i1 @src(double %0) {
if.end155:
%1 = fptrunc double %0 to float
%2 = fcmp oge float %1, 1.000000e+02
ret i1 %2
}
define i1 @tgt(double %0) {
if.end155:
%oge = fcmp oge double %0, 0x4058FFFFF0000000
ret i1 %oge
}

Other variants may follow the same patterns.

Metadata

Metadata

Labels

floating-pointFloating-point mathgood first issuehttps://github.com/llvm/llvm-project/contributellvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions