diff options
| author | Chris Lattner <sabre@nondot.org> | 2006-02-28 05:40:55 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2006-02-28 05:40:55 +0000 |
| commit | 2a7c7b8babcfc0d7249c473dffda0154277ad186 (patch) | |
| tree | 2afe197c547c59d8864307eed3bdb72d5fdb6d13 /llvm/lib/Transforms/Scalar/InstructionCombining.cpp | |
| parent | 626f96431b370d50057b97ba7904df8563a8731d (diff) | |
| download | bcm5719-llvm-2a7c7b8babcfc0d7249c473dffda0154277ad186.tar.gz bcm5719-llvm-2a7c7b8babcfc0d7249c473dffda0154277ad186.zip | |
Simplify some code now that the RHS of a rem can't be 0
llvm-svn: 26413
Diffstat (limited to 'llvm/lib/Transforms/Scalar/InstructionCombining.cpp')
| -rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 80444028d2e..3caa4cf10e9 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/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<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))) { |

