[llvm] [DAGCombiner] Extend FP-to-Int cast without requiring nsz (PR #161093)

via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 29 09:29:46 PDT 2025


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 cpp -- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
``````````

: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/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index 74f601557..c071c9255 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -18860,8 +18860,10 @@ static SDValue foldFPToIntToFP(SDNode *N, const SDLoc &DL, SelectionDAG &DAG,
   // We can fold the fpto[us]i -> [us]itofp pattern into a single ftrunc.
   // If NoSignedZerosFPMath is enabled, this is a direct replacement.
   // Otherwise, for strict math, we must handle edge cases:
-  // 1. For unsigned conversions, use FABS to handle negative cases. Take -0.0 as example,
-  //    it first becomes integer 0, and is converted back to +0.0. FTRUNC on its own could produce -0.0.
+  // 1. For unsigned conversions, use FABS to handle negative cases. Take -0.0
+  // as example,
+  //    it first becomes integer 0, and is converted back to +0.0. FTRUNC on its
+  //    own could produce -0.0.
 
   // FIXME: We should be able to use node-level FMF here.
   EVT VT = N->getValueType(0);

``````````

</details>


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


More information about the llvm-commits mailing list