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 af200e9237
commit 7abf352f44
1 changed files with 1 additions and 2 deletions

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)) ||