[llvm] [X86] Match SETCC_CARRY in addition of SUB when trying to reconstruct LEA (PR #126551)

via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 10 09:32:50 PST 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 729416e586fba71b4f63d71b1b5c765aefbf200b 387ac4339feefa67b1f65efa17587b550db76982 --extensions cpp -- llvm/lib/Target/X86/X86ISelLowering.cpp
``````````

</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 601f51ec9b..7d8daa7427 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -51988,13 +51988,16 @@ static SDValue combineOr(SDNode *N, SelectionDAG &DAG,
   if (VT == MVT::i32 || VT == MVT::i64) {
     if (auto *CN = dyn_cast<ConstantSDNode>(N1)) {
       unsigned Val = CN->getZExtValue();
-      if (Val == 1 || Val == 2 || Val == 3 || Val == 4 || Val == 7 || Val == 8) {
+      if (Val == 1 || Val == 2 || Val == 3 || Val == 4 || Val == 7 ||
+          Val == 8) {
         SDValue NotCond;
-        if (N0.getOpcode() == X86ISD::SETCC_CARRY && N0.hasOneUse() && N0.getOperand(1).hasOneUse()) {
+        if (N0.getOpcode() == X86ISD::SETCC_CARRY && N0.hasOneUse() &&
+            N0.getOperand(1).hasOneUse()) {
           X86::CondCode OldCC = (X86::CondCode)N0.getConstantOperandVal(0);
           X86::CondCode NewCC = X86::GetOppositeBranchCondition(OldCC);
           NotCond = getSETCC(NewCC, N0.getOperand(1), SDLoc(N0), DAG);
-        } else if (N0.getOpcode() == ISD::SUB && N0.hasOneUse() && isNullConstant(N0.getOperand(0))) {
+        } else if (N0.getOpcode() == ISD::SUB && N0.hasOneUse() &&
+                   isNullConstant(N0.getOperand(0))) {
           SDValue Cond = N0.getOperand(1);
           if (Cond.getOpcode() == ISD::ZERO_EXTEND && Cond.hasOneUse())
             Cond = Cond.getOperand(0);

``````````

</details>


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


More information about the llvm-commits mailing list