forked from OSchip/llvm-project
Fix InstCombine/2004-08-09-RemInfLoop.llx
This should go into the 1.3 branch llvm-svn: 15593
This commit is contained in:
parent
cf5dd04f8b
commit
8e7260652b
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue