[llvm] X86: Emit adox instead of adc for overflow add (PR #216609)
via llvm-commits
llvm-commits at lists.llvm.org
Sun Aug 16 15:20:14 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/Target/X86/X86ISelLowering.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/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 69f6ff623..769f24cd8 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -25338,8 +25338,9 @@ static bool isX86LogicalCmp(SDValue Op) {
return true;
if (Op.getResNo() == 1 &&
(Opc == X86ISD::ADD || Opc == X86ISD::SUB || Opc == X86ISD::ADC ||
- Opc == X86ISD::ADOX || Opc == X86ISD::SBB || Opc == X86ISD::SMUL || Opc == X86ISD::UMUL ||
- Opc == X86ISD::OR || Opc == X86ISD::XOR || Opc == X86ISD::AND))
+ Opc == X86ISD::ADOX || Opc == X86ISD::SBB || Opc == X86ISD::SMUL ||
+ Opc == X86ISD::UMUL || Opc == X86ISD::OR || Opc == X86ISD::XOR ||
+ Opc == X86ISD::AND))
return true;
return false;
@@ -53534,11 +53535,11 @@ static SDValue combineAddOrSubToADCOrSBB(bool IsSub, const SDLoc &DL, EVT VT,
DAG.getVTList(VT, MVT::i32), X,
DAG.getConstant(0, DL, VT), EFLAGS);
}
-
- if (!IsSub && CC == X86::COND_O && DAG.getSubtarget<X86Subtarget>().hasADX()) {
+
+ if (!IsSub && CC == X86::COND_O &&
+ DAG.getSubtarget<X86Subtarget>().hasADX()) {
// X + SETO Z --> adox X, 0
- return DAG.getNode(X86ISD::ADOX, DL,
- DAG.getVTList(VT, MVT::i32), X,
+ return DAG.getNode(X86ISD::ADOX, DL, DAG.getVTList(VT, MVT::i32), X,
DAG.getConstant(0, DL, VT), EFLAGS);
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/216609
More information about the llvm-commits
mailing list