diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-03-26 23:58:26 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-03-26 23:58:26 +0000 |
commit | 6eb0d99f5fc729e5e2fd91fbc8a27c1f8d79a270 (patch) | |
tree | f6f612db492c40178aeed07f9a75c873ac593f8e /lib/Transforms | |
parent | fecaf1a2b61e7119cb58672d21718a11a85171f7 (diff) |
Implement some minor review feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35373 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/Scalar/InstructionCombining.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index b7c14c6f00..26468c760d 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp @@ -2455,7 +2455,7 @@ Instruction *InstCombiner::visitUDiv(BinaryOperator &I) { // Check to see if this is an unsigned division with an exact power of 2, // if so, convert to a right shift. if (ConstantInt *C = dyn_cast<ConstantInt>(Op1)) { - if (!C->isZero() && C->getValue().isPowerOf2()) // Don't break X / 0 + if (C->getValue().isPowerOf2()) // 0 not included in isPowerOf2 return BinaryOperator::createLShr(Op0, ConstantInt::get(Op0->getType(), C->getValue().logBase2())); } @@ -3149,7 +3149,7 @@ Value *InstCombiner::FoldLogicalPlusAnd(Value *LHS, Value *RHS, // If the AndRHS is a power of two minus one (0+1+), and N&Mask == 0 if ((Mask->getValue().countLeadingZeros() + Mask->getValue().countPopulation()) == Mask->getValue().getBitWidth() - && And(N, Mask)->isNullValue()) + && And(N, Mask)->isZero()) break; return 0; } @@ -3180,7 +3180,7 @@ Instruction *InstCombiner::visitAnd(BinaryOperator &I) { APInt KnownZero(BitWidth, 0), KnownOne(BitWidth, 0); if (SimplifyDemandedBits(&I, APInt::getAllOnesValue(BitWidth), KnownZero, KnownOne)) - return &I; + return &I; } else { if (ConstantVector *CP = dyn_cast<ConstantVector>(Op1)) { if (CP->isAllOnesValue()) |