mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-11-15 20:06:46 +00:00
Implement isOneBitSet in terms of APInt::countPopulation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35186 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
5a1e3e1a7d
commit
44e33e674a
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user