[llvm] [InstCombine] Fold more 'fcmp' 'select' instrs idioms into 'fabs' (PR #83381)

via llvm-commits llvm-commits at lists.llvm.org
Wed Feb 28 22:57:30 PST 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 3246c44789546fa926784911e349202d8fd8e33b b6429e60da11cd30d47f03dc593c998706c59b24 -- llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
``````````

</details>

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

``````````diff
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
index bd56d92d5d..18f889550a 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
@@ -2745,8 +2745,9 @@ static Instruction *foldSelectWithFCmpToFabs(SelectInst &SI,
     if (!SI.hasNoNaNs())
       return nullptr;
 
-    bool functionHasNoSignedZeroes = SI.getParent()->getParent()->hasFnAttribute("no-signed-zeros-fp-math");
-    if(!functionHasNoSignedZeroes && !SI.hasNoSignedZeros())
+    bool functionHasNoSignedZeroes =
+        SI.getParent()->getParent()->hasFnAttribute("no-signed-zeros-fp-math");
+    if (!functionHasNoSignedZeroes && !SI.hasNoSignedZeros())
       return nullptr;
 
     if (Swap)

``````````

</details>


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


More information about the llvm-commits mailing list