This should go into the 1.3 branch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15593
91177308-0d34-0410-b5e6-
96231b3b80d8
if (I.getType()->isSigned())
if (Value *RHSNeg = dyn_castNegVal(I.getOperand(1)))
if (!isa<ConstantSInt>(RHSNeg) ||
if (I.getType()->isSigned())
if (Value *RHSNeg = dyn_castNegVal(I.getOperand(1)))
if (!isa<ConstantSInt>(RHSNeg) ||
- cast<ConstantSInt>(RHSNeg)->getValue() >= 0) {
+ cast<ConstantSInt>(RHSNeg)->getValue() > 0) {
// X % -Y -> X % Y
AddUsesToWorkList(I);
I.setOperand(1, RHSNeg);
// X % -Y -> X % Y
AddUsesToWorkList(I);
I.setOperand(1, RHSNeg);