Index: llvm/lib/Target/RISCV/RISCVISelLowering.cpp =================================================================== --- llvm/lib/Target/RISCV/RISCVISelLowering.cpp +++ llvm/lib/Target/RISCV/RISCVISelLowering.cpp @@ -3636,10 +3636,6 @@ if (isa(RHS)) { int64_t Imm = cast(RHS)->getSExtValue(); if (Imm != 0 && isInt<12>((uint64_t)Imm + 1)) { - // If this is an unsigned compare and the constant is -1, incrementing - // the constant would change behavior. The result should be false. - if (CCVal == ISD::SETUGT && Imm == -1) - return DAG.getConstant(0, DL, VT); // Using getSetCCSwappedOperands will convert SET(U)GT->SET(U)LT. CCVal = ISD::getSetCCSwappedOperands(CCVal); SDValue SetCC = DAG.getSetCC(