Skip to content

Commit 9c58c9c

Browse files
committed
added more tests
1 parent c171c4d commit 9c58c9c

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

llvm/lib/Analysis/ConstantFolding.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3806,8 +3806,10 @@ bool llvm::isMathLibCallNoop(const CallBase *Call,
38063806
case LibFunc_log10:
38073807
case LibFunc_log10f:
38083808
return Op.isNaN() || (!Op.isZero() && !Op.isNegative());
3809+
38093810
case LibFunc_ilogb:
3810-
return !(Op.isNaN()) && !(Op.isZero() || Op.isInfinity());
3811+
return !Op.isNaN() && (!Op.isZero() && !Op.isInfinity());
3812+
38113813
case LibFunc_expl:
38123814
case LibFunc_exp:
38133815
case LibFunc_expf:

llvm/test/Transforms/Util/libcalls-shrinkwrap-float.ll

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,8 @@ entry:
223223
; CHECK-NEXT: %call_11 = call float @log1pf(float %value)
224224
; CHECK-NEXT: br label %[[END_LABEL]]
225225
; CHECK: [[END_LABEL]]:
226+
227+
%call_12 = call i32 @ilogb(float %value)
226228
ret void
227229
}
228230

@@ -351,5 +353,6 @@ declare float @log10f(float)
351353
declare float @log2f(float)
352354
declare float @logbf(float)
353355
declare float @log1pf(float)
356+
declare i32 @ilogb(float)
354357

355358
; CHECK: ![[BRANCH_WEIGHT]] = !{!"branch_weights", i32 1, i32 1048575}

0 commit comments

Comments
 (0)