Don't make TwoToExp signed by default.

llvm-svn: 60279
This commit is contained in:
Bill Wendling 2008-11-30 05:29:33 +00:00
parent 4e018f4c22
commit 115290ddd3

View File

@ -2960,8 +2960,7 @@ Instruction *InstCombiner::visitSDiv(BinaryOperator &I) {
APInt RHSNegAPI(RHSNeg->getBitWidth(), RHSNeg->getSExtValue(), true);
APInt NegOne = -APInt(RHSNeg->getBitWidth(), 1, true);
APInt TwoToExp(RHSNeg->getBitWidth(), 1 << (RHSNeg->getBitWidth() - 1),
true);
APInt TwoToExp(RHSNeg->getBitWidth(), 1 << (RHSNeg->getBitWidth() - 1));
// -X/C -> X/-C, if and only if negation doesn't overflow.
if ((RHS->getSExtValue() < 0 && RHSNegAPI.slt(TwoToExp - 1)) ||