From 2a7c7b8babcfc0d7249c473dffda0154277ad186 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 28 Feb 2006 05:40:55 +0000 Subject: [PATCH] Simplify some code now that the RHS of a rem can't be 0 llvm-svn: 26413 --- .../lib/Transforms/Scalar/InstructionCombining.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index 80444028d2e3..3caa4cf10e9f 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(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))) {