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

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 12 18:54:34 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:

I assume it's still wrong on the scalar libcall that's used by clang without -ffast-math, but we just don't have test for it.

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


More information about the llvm-commits mailing list