mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-01-23 02:32:11 +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:
parent
e7f2aa74c0
commit
6c9951b0da
@ -1867,14 +1867,12 @@ Instruction *InstCombiner::visitRem(BinaryOperator &I) {
|
||||
if (isPowerOf2_64(C->getValue()))
|
||||
return BinaryOperator::createAnd(Op0, SubOne(C));
|
||||
|
||||
if (!RHS->isNullValue()) {
|
||||
if (SelectInst *SI = dyn_cast<SelectInst>(Op0))
|
||||
if (Instruction *R = FoldOpIntoSelect(I, SI, this))
|
||||
return R;
|
||||
if (isa<PHINode>(Op0))
|
||||
if (Instruction *NV = FoldOpIntoPhi(I))
|
||||
return NV;
|
||||
}
|
||||
if (SelectInst *SI = dyn_cast<SelectInst>(Op0))
|
||||
if (Instruction *R = FoldOpIntoSelect(I, SI, this))
|
||||
return R;
|
||||
if (isa<PHINode>(Op0))
|
||||
if (Instruction *NV = FoldOpIntoPhi(I))
|
||||
return NV;
|
||||
}
|
||||
|
||||
if (Instruction *RHSI = dyn_cast<Instruction>(I.getOperand(1))) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user