mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-08 19:25:47 +00:00
Don't make TwoToExp signed by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60279 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -2960,8 +2960,7 @@ Instruction *InstCombiner::visitSDiv(BinaryOperator &I) {
|
|||||||
APInt RHSNegAPI(RHSNeg->getBitWidth(), RHSNeg->getSExtValue(), true);
|
APInt RHSNegAPI(RHSNeg->getBitWidth(), RHSNeg->getSExtValue(), true);
|
||||||
|
|
||||||
APInt NegOne = -APInt(RHSNeg->getBitWidth(), 1, true);
|
APInt NegOne = -APInt(RHSNeg->getBitWidth(), 1, true);
|
||||||
APInt TwoToExp(RHSNeg->getBitWidth(), 1 << (RHSNeg->getBitWidth() - 1),
|
APInt TwoToExp(RHSNeg->getBitWidth(), 1 << (RHSNeg->getBitWidth() - 1));
|
||||||
true);
|
|
||||||
|
|
||||||
// -X/C -> X/-C, if and only if negation doesn't overflow.
|
// -X/C -> X/-C, if and only if negation doesn't overflow.
|
||||||
if ((RHS->getSExtValue() < 0 && RHSNegAPI.slt(TwoToExp - 1)) ||
|
if ((RHS->getSExtValue() < 0 && RHSNegAPI.slt(TwoToExp - 1)) ||
|
||||||
|
Reference in New Issue
Block a user