commit | 5f6a89562d5faeec3cf5e141373917284c34102d | [log] [tgz] |
---|---|---|
author | Reid Spencer <rspencer@reidspencer.com> | Tue Mar 20 00:16:52 2007 +0000 |
committer | Reid Spencer <rspencer@reidspencer.com> | Tue Mar 20 00:16:52 2007 +0000 |
tree | 3a1fbb9d142054fc91d31991692ead0bd3b21c88 | |
parent | 8cf47cef5c964208137a0ada46ea35fc811e888d [diff] [blame] |
Make isOneBitSet faster by using APInt::isPowerOf2. Thanks Chris. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35194 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/InstructionCombining.cpp b/lib/Transforms/Scalar/InstructionCombining.cpp index c87a351..287a007 100644 --- a/lib/Transforms/Scalar/InstructionCombining.cpp +++ b/lib/Transforms/Scalar/InstructionCombining.cpp
@@ -3472,7 +3472,7 @@ // 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