[llvm] SelectionDAG: Fold saturations into min/max (PR #201899)
via llvm-commits
llvm-commits at lists.llvm.org
Fri Jun 5 10:56:22 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 cpp -- llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp llvm/lib/Target/ARM/ARMISelLowering.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/CodeGen/SelectionDAG/DAGCombiner.cpp b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
index ddd31e5b7..45b65da09 100644
--- a/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
@@ -614,8 +614,8 @@ namespace {
SDValue False, ISD::CondCode CC, const SDLoc &DL);
SDValue foldSelectToUMin(SDValue LHS, SDValue RHS, SDValue True,
SDValue False, ISD::CondCode CC, const SDLoc &DL);
- SDValue foldSelectToMinMax(const SDLoc &DL, EVT VT, SDValue LHS, SDValue RHS,
- SDValue TrueVal, SDValue FalseVal,
+ SDValue foldSelectToMinMax(const SDLoc &DL, EVT VT, SDValue LHS,
+ SDValue RHS, SDValue TrueVal, SDValue FalseVal,
ISD::CondCode CC);
SDValue unfoldMaskedMerge(SDNode *N);
SDValue unfoldExtremeBitClearingToShifts(SDNode *N);
@@ -14460,7 +14460,8 @@ SDValue DAGCombiner::visitSELECT_CC(SDNode *N) {
if (N2 == N3)
return N2;
- if (SDValue MinMax = foldSelectToMinMax(DL, N->getValueType(0), N0, N1, N2, N3, CC))
+ if (SDValue MinMax =
+ foldSelectToMinMax(DL, N->getValueType(0), N0, N1, N2, N3, CC))
return MinMax;
// select_cc bool, 0, x, y, seteq -> select bool, y, x
``````````
</details>
https://github.com/llvm/llvm-project/pull/201899
More information about the llvm-commits
mailing list