-
Notifications
You must be signed in to change notification settings - Fork 14.8k
Closed
Closed
Copy link
Labels
floating-pointFloating-point mathFloating-point mathgood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contributellvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization
Description
define float @src(float %x, i1 %bool) {
%zext = zext i1 %bool to i32
%ldexp = call float @llvm.ldexp.f32.i32(float %x, i32 %zext)
ret float %ldexp
}
define float @tgt(float %x, i1 %bool) {
%select = select i1 %bool, float 2.000000e+00, float 1.000000e+00
%mul = fmul float %x, %select
ret float %mul
}
I noticed the pattern while looking at builtin math library code
Metadata
Metadata
Assignees
Labels
floating-pointFloating-point mathFloating-point mathgood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contributellvm:instcombineCovers the InstCombine, InstSimplify and AggressiveInstCombine passesCovers the InstCombine, InstSimplify and AggressiveInstCombine passesmissed-optimization