From 6c9951b0da0e534664018e0fdb81606e714ff63c 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 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26413 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/InstructionCombining.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) 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))) { -- 2.34.1