Skip to content

Commit c2d1a16

Browse files
committed
address review comments
1 parent 9035db8 commit c2d1a16

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

llvm/lib/Analysis/ConstantFolding.cpp

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1774,17 +1774,6 @@ inline bool llvm_fenv_testexcept() {
17741774
return false;
17751775
}
17761776

1777-
Constant *ConstantFoldInt(int (*NativeFP)(double), const APFloat &V, Type *Ty) {
1778-
llvm_fenv_clearexcept();
1779-
int Result = NativeFP(V.convertToDouble());
1780-
if (llvm_fenv_testexcept()) {
1781-
llvm_fenv_clearexcept();
1782-
return nullptr;
1783-
}
1784-
1785-
return ConstantInt::get(Ty, Result, true);
1786-
}
1787-
17881777
Constant *ConstantFoldFP(double (*NativeFP)(double), const APFloat &V,
17891778
Type *Ty) {
17901779
llvm_fenv_clearexcept();
@@ -2408,7 +2397,7 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
24082397
case LibFunc_ilogb:
24092398
case LibFunc_ilogbf:
24102399
if (!APF.isZero() && TLI->has(Func))
2411-
return ConstantFoldInt(ilogb, APF, Ty);
2400+
return ConstantInt::get(Ty, ilogb(APF), true);
24122401
break;
24132402
case LibFunc_logb:
24142403
case LibFunc_logbf:

0 commit comments

Comments
 (0)