Index: llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp +++ llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp @@ -2258,7 +2258,7 @@ SDValue Ovf; bool HasOpCarry = TLI.isOperationLegalOrCustom( - N->getOpcode() == ISD::ADD ? ISD::ADDCARRY : ISD::SUBCARRY, + N->getOpcode() == ISD::UADDO ? ISD::ADDCARRY : ISD::SUBCARRY, TLI.getTypeToExpandTo(*DAG.getContext(), LHS.getValueType())); if (HasOpCarry) {