[llvm] [X86] Allow disjoint ors in combineAddOrSubToADCOrSBB (PR #218410)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Mon Aug 24 07:21:06 PDT 2026
================
@@ -53639,9 +53627,13 @@ static SDValue combineAddOrSubToADCOrSBB(bool IsSub, const SDLoc &DL, EVT VT,
/// with CMP+{ADC, SBB}.
static SDValue combineAddOrSubToADCOrSBB(SDNode *N, const SDLoc &DL,
SelectionDAG &DAG) {
- bool IsSub = N->getOpcode() == ISD::SUB;
SDValue X = N->getOperand(0);
SDValue Y = N->getOperand(1);
+
+ if (N->getOpcode() == ISD::OR && !N->getFlags().hasDisjoint())
+ return SDValue();
+
+ bool IsSub = N->getOpcode() == ISD::SUB;
----------------
RKSimon wrote:
You shouldn't need to move the IsSub/VT lines? Just check for disjoint OR afterward
https://github.com/llvm/llvm-project/pull/218410
More information about the llvm-commits
mailing list