mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 16:19:52 +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,14 +1867,12 @@ 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;
|
if (isa<PHINode>(Op0))
|
||||||
if (isa<PHINode>(Op0))
|
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))) {
|
||||||
|
|||||||
Reference in New Issue
Block a user