srem doesn't actually have the same resulting sign as its numerator, you could

also have a zero when numerator = denominator. Reverts parts of r126635 and
r126637.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126644 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Nick Lewycky
2011-02-28 09:17:39 +00:00
parent b042f8e969
commit 3dc7e49c70
3 changed files with 5 additions and 37 deletions

View File

@@ -1348,16 +1348,6 @@ Instruction *InstCombiner::visitICmpInstWithInstAndIntCst(ICmpInst &ICI,
}
}
break;
case Instruction::SRem: {
bool TrueIfSigned;
if (LHSI->hasOneUse() &&
isSignBitCheck(ICI.getPredicate(), RHS, TrueIfSigned)) {
// srem has the same sign as its dividend so the divisor is irrelevant.
return new ICmpInst(ICI.getPredicate(), LHSI->getOperand(0), RHS);
}
break;
}
}
// Simplify icmp_eq and icmp_ne instructions with integer constant RHS.