[llvm] [ConstantFold] Fold `erf` and `erff` when the input parameter is a constant value. (PR #113079)

via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 21 18:35:07 PDT 2024


================
@@ -3624,6 +3628,10 @@ bool llvm::isMathLibCallNoop(const CallBase *Call,
       case LibFunc_sqrtf:
         return Op.isNaN() || Op.isZero() || !Op.isNegative();
 
+      case LibFunc_erf:
+      case LibFunc_erff:
+        return true;
----------------
c8ef wrote:

It appears that the handling of current overflow and underflow in `isMathLibCallNoop` is similar to the `exp` function. Therefore, after removing the code snippet in `isMathLibCallNoop`, it will simply return false, indicating that it is not a no-op.

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


More information about the llvm-commits mailing list