diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index eb4f1e31a6a..bf0f0e839d0 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -829,7 +829,7 @@ Instruction *InstCombiner::visitRem(BinaryOperator &I) { if (I.getType()->isSigned()) if (Value *RHSNeg = dyn_castNegVal(I.getOperand(1))) if (!isa(RHSNeg) || - cast(RHSNeg)->getValue() >= 0) { + cast(RHSNeg)->getValue() > 0) { // X % -Y -> X % Y AddUsesToWorkList(I); I.setOperand(1, RHSNeg);