Simplify some code now that the RHS of a rem can't be 0

llvm-svn: 26413
This commit is contained in:
Chris Lattner 2006-02-28 05:40:55 +00:00
parent 626f96431b
commit 2a7c7b8bab
1 changed files with 6 additions and 8 deletions

View File

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