[llvm] [ConstantFold] Fold `log1p` and `log1pf` when the input parameter is a constant value. (PR #112113)
Yingwei Zheng via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 14 20:51:49 PDT 2024
================
@@ -2394,6 +2395,11 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
if (!APF.isZero() && TLI->has(Func))
return ConstantFoldFP(logb, APF, Ty);
break;
+ case LibFunc_log1p:
+ case LibFunc_log1pf:
+ if (APF > APFloat(APF.getSemantics(), "-1") && TLI->has(Func))
----------------
dtcxzyw wrote:
I will fix this.
https://github.com/llvm/llvm-project/pull/112113
More information about the llvm-commits
mailing list