From: Chris Lattner Date: Tue, 28 Feb 2006 05:40:55 +0000 (+0000) Subject: Simplify some code now that the RHS of a rem can't be 0 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=6c9951b0da0e534664018e0fdb81606e714ff63c;p=oota-llvm.git 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 --- diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index 80444028d2e..3caa4cf10e9 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -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(Op0)) - if (Instruction *R = FoldOpIntoSelect(I, SI, this)) - return R; - if (isa(Op0)) - if (Instruction *NV = FoldOpIntoPhi(I)) - return NV; - } + if (SelectInst *SI = dyn_cast(Op0)) + if (Instruction *R = FoldOpIntoSelect(I, SI, this)) + return R; + if (isa(Op0)) + if (Instruction *NV = FoldOpIntoPhi(I)) + return NV; } if (Instruction *RHSI = dyn_cast(I.getOperand(1))) {