Fix InstCombine/2004-08-09-RemInfLoop.llx

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
This commit is contained in:
Chris Lattner 2004-08-09 21:05:48 +00:00
parent efd0149de9
commit b49f306bdf

View File

@ -829,7 +829,7 @@ Instruction *InstCombiner::visitRem(BinaryOperator &I) {
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);