[llvm] [KnownFPClass] Refine known classes for `atan2(y, x)` when `x` is negative (PR #214629)

via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 6 22:01:59 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp -- llvm/include/llvm/Support/KnownFPClass.h llvm/lib/Analysis/ValueTracking.cpp llvm/lib/CodeGen/GlobalISel/GISelValueTracking.cpp llvm/lib/Support/KnownFPClass.cpp llvm/unittests/CodeGen/GlobalISel/KnownFPClassTest.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/llvm/lib/Support/KnownFPClass.cpp b/llvm/lib/Support/KnownFPClass.cpp
index a42d35bca..61108e120 100644
--- a/llvm/lib/Support/KnownFPClass.cpp
+++ b/llvm/lib/Support/KnownFPClass.cpp
@@ -698,9 +698,8 @@ KnownFPClass KnownFPClass::atan2(const KnownFPClass &KnownY,
     Known.knownNot(fcNan);
 
   // Negative subnormals could be treated like positive zero.
-  const bool XCannotHavePositiveValue =
-    KnownX.isKnownNever(fcPositive) &&
-    KnownX.isKnownNeverLogicalPosZero(Mode);
+  const bool XCannotHavePositiveValue = KnownX.isKnownNever(fcPositive) &&
+                                        KnownX.isKnownNeverLogicalPosZero(Mode);
 
   // If x <= -0, then |atan2(y, x)| >= pi/2
   if (XCannotHavePositiveValue)

``````````

</details>


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


More information about the llvm-commits mailing list