[llvm] [InstCombine] fold float clamp pattern into llvm.max/min (PR #159652)
via llvm-commits
llvm-commits at lists.llvm.org
Thu Sep 18 14:19:38 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/Transforms/InstCombine/InstCombineSelect.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/Transforms/InstCombine/InstCombineSelect.cpp b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
index f38e886a3..0b874a0d5 100644
--- a/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
+++ b/llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
@@ -4010,8 +4010,9 @@ static Value *foldSelectICmpIntoMaxMin(SelectInst &SI,
// Note: OneUse check for `Cmp` is necessary because it makes sure that other
// InstCombine folds don't undo this transformation and cause an infinite
// loop. Furthermore, it could also increase the operation count.
- if (match(&SI, m_OneUse(m_Select(m_OneUse(m_FCmp(Pred, m_Value(X), m_Value(Y))),
- m_Value(TVal), m_Value(FVal)))))
+ if (match(&SI,
+ m_OneUse(m_Select(m_OneUse(m_FCmp(Pred, m_Value(X), m_Value(Y))),
+ m_Value(TVal), m_Value(FVal)))))
return TryFoldIntoMaxMinIntrinsic(Pred, X, Y, TVal, FVal);
return nullptr;
``````````
</details>
https://github.com/llvm/llvm-project/pull/159652
More information about the llvm-commits
mailing list