mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-24 08:18:33 +00:00
Simplify some code now that the RHS of a rem can't be 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26413 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1867,7 +1867,6 @@ Instruction *InstCombiner::visitRem(BinaryOperator &I) {
|
|||||||
if (isPowerOf2_64(C->getValue()))
|
if (isPowerOf2_64(C->getValue()))
|
||||||
return BinaryOperator::createAnd(Op0, SubOne(C));
|
return BinaryOperator::createAnd(Op0, SubOne(C));
|
||||||
|
|
||||||
if (!RHS->isNullValue()) {
|
|
||||||
if (SelectInst *SI = dyn_cast<SelectInst>(Op0))
|
if (SelectInst *SI = dyn_cast<SelectInst>(Op0))
|
||||||
if (Instruction *R = FoldOpIntoSelect(I, SI, this))
|
if (Instruction *R = FoldOpIntoSelect(I, SI, this))
|
||||||
return R;
|
return R;
|
||||||
@@ -1875,7 +1874,6 @@ Instruction *InstCombiner::visitRem(BinaryOperator &I) {
|
|||||||
if (Instruction *NV = FoldOpIntoPhi(I))
|
if (Instruction *NV = FoldOpIntoPhi(I))
|
||||||
return NV;
|
return NV;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (Instruction *RHSI = dyn_cast<Instruction>(I.getOperand(1))) {
|
if (Instruction *RHSI = dyn_cast<Instruction>(I.getOperand(1))) {
|
||||||
// Turn A % (C << N), where C is 2^k, into A & ((C << N)-1) [urem only].
|
// Turn A % (C << N), where C is 2^k, into A & ((C << N)-1) [urem only].
|
||||||
|
|||||||
Reference in New Issue
Block a user