summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2007-03-19 21:04:43 +0000
committerReid Spencer <rspencer@reidspencer.com>2007-03-19 21:04:43 +0000
commit129a86792d1a356d0da7ccea7c4262448c1d37ea (patch)
tree85007cc0edd77e26612e6363a557fd67ff4a1b8b /llvm/lib
parent450434ed659bcc548a3ac01e8fa40786fa722154 (diff)
downloadbcm5719-llvm-129a86792d1a356d0da7ccea7c4262448c1d37ea.tar.gz
bcm5719-llvm-129a86792d1a356d0da7ccea7c4262448c1d37ea.zip
Implement isOneBitSet in terms of APInt::countPopulation.
llvm-svn: 35186
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Transforms/Scalar/InstructionCombining.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
index e38622a569f..dbe694fad78 100644
--- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
+++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -3474,8 +3474,7 @@ static bool isMinValuePlusOne(const ConstantInt *C, bool isSigned) {
// isOneBitSet - Return true if there is exactly one bit set in the specified
// constant.
static bool isOneBitSet(const ConstantInt *CI) {
- uint64_t V = CI->getZExtValue();
- return V && (V & (V-1)) == 0;
+ return CI->getValue().countPopulation() == 1;
}
#if 0 // Currently unused
OpenPOWER on IntegriCloud