[llvm] [ConstantFold] Fold `log1p` and `log1pf` when the input parameter is a constant value. (PR #112113)

via llvm-commits llvm-commits at lists.llvm.org
Tue Oct 15 06:00:09 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))
----------------
c8ef wrote:

Done.

https://github.com/llvm/llvm-project/pull/112113


More information about the llvm-commits mailing list