Skip to content

Commit 34a8746

Browse files
committed
APFloat::getOne
1 parent 3c04e28 commit 34a8746

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Analysis/ConstantFolding.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2397,7 +2397,7 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
23972397
break;
23982398
case LibFunc_log1p:
23992399
case LibFunc_log1pf:
2400-
if (APF > APFloat(APF.getSemantics(), "-1") && TLI->has(Func))
2400+
if (APF > APFloat::getOne(APF.getSemantics(), true) && TLI->has(Func))
24012401
return ConstantFoldFP(log1p, APF, Ty);
24022402
break;
24032403
case LibFunc_logl:
@@ -3594,8 +3594,8 @@ bool llvm::isMathLibCallNoop(const CallBase *Call,
35943594
case LibFunc_acosl:
35953595
case LibFunc_acos:
35963596
case LibFunc_acosf:
3597-
return !(Op < APFloat(Op.getSemantics(), "-1") ||
3598-
Op > APFloat(Op.getSemantics(), "1"));
3597+
return !(Op < APFloat::getOne(Op.getSemantics(), true) ||
3598+
Op > APFloat::getOne(Op.getSemantics()));
35993599

36003600
case LibFunc_sinh:
36013601
case LibFunc_cosh:

0 commit comments

Comments
 (0)