[llvm] Optimize fptrunc(x)>=C1 --> x>=C2 (PR #99475)

via llvm-commits llvm-commits at lists.llvm.org
Sun Oct 20 16:09:08 PDT 2024


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 4a19be5d45e4b1e02c2512023151be5d56ef5744 5cc33ac5e033690481505cb722695fbf3d345478 --extensions cpp -- llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
index 8894a337edd..adaac13a2ad 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
@@ -7932,15 +7932,15 @@ static Instruction *foldFCmpFpTrunc(FCmpInst &I, Instruction *LHSI,
   ExtNextRValue.convert(LEleType->getFltSemantics(),
                         APFloat::rmNearestTiesToEven, &lossInfo);
 
-  // Binary search to find the maximal (or minimal) value after RValue promotion.
-  // RValue can't have special comparison rules, which means nan or inf is not
-  // allowed here.
+  // Binary search to find the maximal (or minimal) value after RValue
+  // promotion. RValue can't have special comparison rules, which means nan or
+  // inf is not allowed here.
   APFloat RoundValue{LEleType->getFltSemantics()};
   {
     APFloat Two{LEleType->getFltSemantics(), 2};
 
-    // The (negative) maximum of RValue will become infinity when rounded up (down).
-    // Set the limit of ExtNextRValue.
+    // The (negative) maximum of RValue will become infinity when rounded up
+    // (down). Set the limit of ExtNextRValue.
     if (NextRValue.isInfinity()) {
       ExtNextRValue = ExtRValue * Two;
     }

``````````

</details>


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


More information about the llvm-commits mailing list