diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2007-03-20 00:16:52 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2007-03-20 00:16:52 +0000 |
commit | 6682721316a6916b2bfd1c2996cdcb2048c7348f (patch) | |
tree | 88c8ef7341b04fdf31b9c4b3f5f19852ea10a271 /llvm/lib/Transforms | |
parent | 09f4eb10982201cd3653bde4fdd4a8d68853da0c (diff) | |
download | bcm5719-llvm-6682721316a6916b2bfd1c2996cdcb2048c7348f.tar.gz bcm5719-llvm-6682721316a6916b2bfd1c2996cdcb2048c7348f.zip |
Make isOneBitSet faster by using APInt::isPowerOf2. Thanks Chris.
llvm-svn: 35194
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r-- | llvm/lib/Transforms/Scalar/InstructionCombining.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp index c87a351e63b..287a0077ec6 100644 --- a/llvm/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/llvm/lib/Transforms/Scalar/InstructionCombining.cpp @@ -3472,7 +3472,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) { - return CI->getValue().countPopulation() == 1; + return CI->getValue().isPowerOf2(); } #if 0 // Currently unused |