[llvm] [ConstantFold] Special case atan +/-0.0 (PR #143962)

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 13 08:48:15 PDT 2025


================
@@ -2549,6 +2549,9 @@ static Constant *ConstantFoldScalarCall1(StringRef Name,
       case Intrinsic::cosh:
         return ConstantFoldFP(cosh, APF, Ty);
       case Intrinsic::atan:
+        // Implement optional behavior from C's Annex F for +/-0.0.
----------------
topperc wrote:

Specifically this code in the same file

```
    case LibFunc_atan:                                                           
    case LibFunc_atanf:                                                          
      if (TLI->has(Func))                                                        
        return ConstantFoldFP(atan, APF, Ty);                                    
      break;
```

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


More information about the llvm-commits mailing list