diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index dc2475bee1400..81bba2f8d5d54 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -6703,9 +6703,9 @@ TargetLowering::prepareSREMEqFold(EVT SETCCVT, SDValue REMNode, // NOTE: we avoid letting illegal types through even if we're before legalize // ops – legalization has a hard time producing good code for the code that // follows. - if (!isOperationLegalOrCustom(ISD::SETEQ, VT) || + if (!isOperationLegalOrCustom(ISD::SETCC, SETCCVT) || !isOperationLegalOrCustom(ISD::AND, VT) || - !isOperationLegalOrCustom(Cond, VT) || + !isCondCodeLegalOrCustom(Cond, VT.getSimpleVT()) || !isOperationLegalOrCustom(ISD::VSELECT, SETCCVT)) return SDValue();