[llvm] [X86] Create special case for (a-b) - (a<b) -> sbb a, b (PR #161388)

via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 30 08:04:29 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/Target/X86/X86ISelLowering.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/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index ffb4fbdcc..b16e77f1f 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -52385,8 +52385,9 @@ static SDValue combineAddOrSubToADCOrSBB(bool IsSub, const SDLoc &DL, EVT VT,
     // fold to: SBB a, b
     if (IsSub && X.getOpcode() == X86ISD::SUB && EFLAGS == X.getValue(1) &&
         X.getValueType().isInteger() && !isa<ConstantSDNode>(X.getOperand(1))) {
-      SDValue NewSub = DAG.getNode(X86ISD::SUB, SDLoc(X), X.getNode()->getVTList(),
-                                   X.getOperand(1), X.getOperand(0));
+      SDValue NewSub =
+          DAG.getNode(X86ISD::SUB, SDLoc(X), X.getNode()->getVTList(),
+                      X.getOperand(1), X.getOperand(0));
       SDValue NewEFLAGS = NewSub.getValue(1);
       return DAG.getNode(X86ISD::SBB, DL, DAG.getVTList(VT, MVT::i32),
                          X.getOperand(0), X.getOperand(1), NewEFLAGS);

``````````

</details>


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


More information about the llvm-commits mailing list