LLVM
8.0.1
|
This is a 'bitvector' (really, a variable-sized bit array), optimized for the case when the array is small. More...
#include "llvm/ADT/SmallBitVector.h"
Classes | |
class | reference |
Public Types | |
using | size_type = unsigned |
using | const_set_bits_iterator = const_set_bits_iterator_impl< SmallBitVector > |
using | set_iterator = const_set_bits_iterator |
Public Member Functions | |
SmallBitVector ()=default | |
Creates an empty bitvector. More... | |
SmallBitVector (unsigned s, bool t=false) | |
Creates a bitvector of specified number of bits. More... | |
SmallBitVector (const SmallBitVector &RHS) | |
SmallBitVector copy ctor. More... | |
SmallBitVector (SmallBitVector &&RHS) | |
~SmallBitVector () | |
const_set_bits_iterator | set_bits_begin () const |
const_set_bits_iterator | set_bits_end () const |
iterator_range< const_set_bits_iterator > | set_bits () const |
bool | isSmall () const |
bool | empty () const |
Tests whether there are no bits in this bitvector. More... | |
size_t | size () const |
Returns the number of bits in this bitvector. More... | |
size_type | count () const |
Returns the number of bits which are set. More... | |
bool | any () const |
Returns true if any bit is set. More... | |
bool | all () const |
Returns true if all bits are set. More... | |
bool | none () const |
Returns true if none of the bits are set. More... | |
int | find_first () const |
Returns the index of the first set bit, -1 if none of the bits are set. More... | |
int | find_last () const |
int | find_first_unset () const |
Returns the index of the first unset bit, -1 if all of the bits are set. More... | |
int | find_last_unset () const |
int | find_next (unsigned Prev) const |
Returns the index of the next set bit following the "Prev" bit. More... | |
int | find_next_unset (unsigned Prev) const |
Returns the index of the next unset bit following the "Prev" bit. More... | |
int | find_prev (unsigned PriorTo) const |
find_prev - Returns the index of the first set bit that precedes the the bit at PriorTo . More... | |
void | clear () |
Clear all bits. More... | |
void | resize (unsigned N, bool t=false) |
Grow or shrink the bitvector. More... | |
void | reserve (unsigned N) |
SmallBitVector & | set () |
SmallBitVector & | set (unsigned Idx) |
SmallBitVector & | set (unsigned I, unsigned E) |
Efficiently set a range of bits in [I, E) More... | |
SmallBitVector & | reset () |
SmallBitVector & | reset (unsigned Idx) |
SmallBitVector & | reset (unsigned I, unsigned E) |
Efficiently reset a range of bits in [I, E) More... | |
SmallBitVector & | flip () |
SmallBitVector & | flip (unsigned Idx) |
SmallBitVector | operator~ () const |
reference | operator[] (unsigned Idx) |
bool | operator[] (unsigned Idx) const |
bool | test (unsigned Idx) const |
void | push_back (bool Val) |
bool | anyCommon (const SmallBitVector &RHS) const |
Test if any common bits are set. More... | |
bool | operator== (const SmallBitVector &RHS) const |
bool | operator!= (const SmallBitVector &RHS) const |
SmallBitVector & | operator &= (const SmallBitVector &RHS) |
SmallBitVector & | reset (const SmallBitVector &RHS) |
Reset bits that are set in RHS. Same as *this &= ~RHS. More... | |
bool | test (const SmallBitVector &RHS) const |
Check if (This - RHS) is zero. This is the same as reset(RHS) and any(). More... | |
SmallBitVector & | operator|= (const SmallBitVector &RHS) |
SmallBitVector & | operator^= (const SmallBitVector &RHS) |
SmallBitVector & | operator<<= (unsigned N) |
SmallBitVector & | operator>>= (unsigned N) |
const SmallBitVector & | operator= (const SmallBitVector &RHS) |
const SmallBitVector & | operator= (SmallBitVector &&RHS) |
void | swap (SmallBitVector &RHS) |
void | setBitsInMask (const uint32_t *Mask, unsigned MaskWords=~0u) |
Add '1' bits from Mask to this vector. More... | |
void | clearBitsInMask (const uint32_t *Mask, unsigned MaskWords=~0u) |
Clear any bits in this vector that are set in Mask. More... | |
void | setBitsNotInMask (const uint32_t *Mask, unsigned MaskWords=~0u) |
Add a bit to this vector for every '0' bit in Mask. More... | |
void | clearBitsNotInMask (const uint32_t *Mask, unsigned MaskWords=~0u) |
Clear a bit in this vector for every '0' bit in Mask. More... | |
This is a 'bitvector' (really, a variable-sized bit array), optimized for the case when the array is small.
It contains one pointer-sized field, which is directly used as a plain collection of bits when possible, or as a pointer to a larger heap-allocated array when necessary. This allows normal "small" cases to be fast without losing generality for large inputs.
Definition at line 35 of file SmallBitVector.h.
Definition at line 170 of file SmallBitVector.h.
Definition at line 171 of file SmallBitVector.h.
Definition at line 64 of file SmallBitVector.h.
|
default |
Creates an empty bitvector.
Referenced by llvm::SmallBitVector::reference::operator bool(), and operator~().
Creates a bitvector of specified number of bits.
All bits are initialized to the specified value.
Definition at line 146 of file SmallBitVector.h.
|
inline |
|
inline |
Definition at line 161 of file SmallBitVector.h.
|
inline |
Definition at line 165 of file SmallBitVector.h.
References isSmall().
|
inline |
Returns true if all bits are set.
Definition at line 214 of file SmallBitVector.h.
References isSmall().
|
inline |
Returns true if any bit is set.
Definition at line 207 of file SmallBitVector.h.
References isSmall().
Referenced by llvm::DependenceInfo::depends(), and llvm::DependenceInfo::getSplitIteration().
|
inline |
Test if any common bits are set.
Definition at line 474 of file SmallBitVector.h.
|
inline |
Clear all bits.
Definition at line 323 of file SmallBitVector.h.
References isSmall().
Referenced by llvm::StatepointLoweringState::clear(), operator=(), and llvm::StatepointLoweringState::startNewStatepoint().
|
inline |
Clear any bits in this vector that are set in Mask.
Don't resize. This computes "*this &= ~Mask".
Definition at line 641 of file SmallBitVector.h.
References isSmall(), and llvm::BitmaskEnumDetail::Mask().
|
inline |
Clear a bit in this vector for every '0' bit in Mask.
Don't resize. This computes "*this &= Mask".
Definition at line 659 of file SmallBitVector.h.
References assert(), isSmall(), and llvm::BitmaskEnumDetail::Mask().
|
inline |
Returns the number of bits which are set.
Definition at line 198 of file SmallBitVector.h.
References llvm::tgtok::Bits, llvm::countPopulation(), and isSmall().
Referenced by llvm::DependenceInfo::depends(), EltsFromConsecutiveLoads(), find_first_unset(), find_last_unset(), llvm::DependenceInfo::getSplitIteration(), lowerVectorShuffleAsSplitOrBlend(), and mayUsePostIncMode().
|
inline |
Tests whether there are no bits in this bitvector.
Definition at line 188 of file SmallBitVector.h.
References isSmall().
|
inline |
Returns the index of the first set bit, -1 if none of the bits are set.
Definition at line 228 of file SmallBitVector.h.
References llvm::tgtok::Bits, llvm::countTrailingZeros(), and isSmall().
Referenced by EltsFromConsecutiveLoads().
|
inline |
Returns the index of the first unset bit, -1 if all of the bits are set.
Definition at line 249 of file SmallBitVector.h.
References llvm::tgtok::Bits, count(), llvm::countTrailingOnes(), and isSmall().
|
inline |
Definition at line 238 of file SmallBitVector.h.
References llvm::tgtok::Bits, llvm::countLeadingZeros(), and isSmall().
|
inline |
Definition at line 260 of file SmallBitVector.h.
References llvm::tgtok::Bits, count(), llvm::countLeadingOnes(), and isSmall().
|
inline |
Returns the index of the next set bit following the "Prev" bit.
Returns -1 if the next set bit is not found.
Definition at line 275 of file SmallBitVector.h.
References llvm::tgtok::Bits, llvm::countTrailingZeros(), and isSmall().
Referenced by dumpSmallBitVector().
|
inline |
Returns the index of the next unset bit following the "Prev" bit.
Returns -1 if the next unset bit is not found.
Definition at line 289 of file SmallBitVector.h.
References llvm::tgtok::Bits, llvm::countTrailingOnes(), isSmall(), and llvm::BitmaskEnumDetail::Mask().
|
inline |
find_prev - Returns the index of the first set bit that precedes the the bit at PriorTo
.
Returns -1 if all previous bits are unset.
Definition at line 306 of file SmallBitVector.h.
References llvm::tgtok::Bits, llvm::countLeadingZeros(), and isSmall().
|
inline |
Definition at line 430 of file SmallBitVector.h.
References isSmall().
|
inline |
Definition at line 438 of file SmallBitVector.h.
References isSmall().
|
inline |
Definition at line 185 of file SmallBitVector.h.
Referenced by all(), any(), anyCommon(), clear(), clearBitsInMask(), clearBitsNotInMask(), count(), empty(), find_first(), find_first_unset(), find_last(), find_last_unset(), find_next(), find_next_unset(), find_prev(), flip(), none(), operator &=(), llvm::SmallBitVector::reference::operator bool(), operator<<=(), operator=(), operator==(), operator>>=(), operator[](), operator^=(), operator|=(), reserve(), reset(), resize(), set(), setBitsInMask(), setBitsNotInMask(), size(), SmallBitVector(), test(), and ~SmallBitVector().
|
inline |
Returns true if none of the bits are set.
Definition at line 221 of file SmallBitVector.h.
References isSmall().
|
inline |
Definition at line 509 of file SmallBitVector.h.
References isSmall(), llvm::max(), reset(), resize(), size(), and test().
|
inline |
Definition at line 503 of file SmallBitVector.h.
|
inline |
Definition at line 584 of file SmallBitVector.h.
|
inline |
Definition at line 601 of file SmallBitVector.h.
References isSmall().
|
inline |
Definition at line 618 of file SmallBitVector.h.
|
inline |
Definition at line 487 of file SmallBitVector.h.
|
inline |
Definition at line 592 of file SmallBitVector.h.
Definition at line 452 of file SmallBitVector.h.
References assert(), llvm::SmallBitVector::reference::reference(), and size().
Definition at line 457 of file SmallBitVector.h.
|
inline |
Definition at line 571 of file SmallBitVector.h.
References isSmall(), llvm::max(), resize(), size(), and test().
|
inline |
Definition at line 558 of file SmallBitVector.h.
References isSmall(), llvm::max(), resize(), size(), and test().
|
inline |
Definition at line 447 of file SmallBitVector.h.
References SmallBitVector().
|
inline |
Definition at line 469 of file SmallBitVector.h.
|
inline |
Definition at line 346 of file SmallBitVector.h.
References isSmall(), llvm::BitVector::reserve(), and llvm::BitVector::set().
|
inline |
Definition at line 399 of file SmallBitVector.h.
References isSmall().
Referenced by llvm::DependenceInfo::depends(), llvm::DependenceInfo::getSplitIteration(), getTypePartition(), operator &=(), llvm::SmallBitVector::reference::operator=(), and reset().
|
inline |
Definition at line 407 of file SmallBitVector.h.
References isSmall().
|
inline |
Efficiently reset a range of bits in [I, E)
Definition at line 416 of file SmallBitVector.h.
References assert(), E, I, isSmall(), llvm::BitmaskEnumDetail::Mask(), and size().
|
inline |
Grow or shrink the bitvector.
Definition at line 330 of file SmallBitVector.h.
References isSmall().
Referenced by llvm::StatepointLoweringState::allocateStackSlot(), lowerVectorShuffleAsSplitOrBlend(), operator &=(), operator^=(), operator|=(), push_back(), and llvm::StatepointLoweringState::startNewStatepoint().
|
inline |
Definition at line 364 of file SmallBitVector.h.
References isSmall(), and set().
Referenced by llvm::DwarfExpression::addMachineReg(), llvm::StatepointLoweringState::allocateStackSlot(), llvm::DependenceInfo::depends(), llvm::LegalizerInfo::getAction(), llvm::DependenceInfo::getSplitIteration(), llvm::MachineInstr::getTypeToPrint(), isLoadOrStore(), llvm::SmallBitVector::reference::operator=(), llvm::StatepointLoweringState::reserveStackSlot(), and set().
|
inline |
Definition at line 372 of file SmallBitVector.h.
|
inline |
Efficiently set a range of bits in [I, E)
Definition at line 385 of file SmallBitVector.h.
References assert(), E, I, isSmall(), llvm::BitmaskEnumDetail::Mask(), and size().
|
inline |
Definition at line 181 of file SmallBitVector.h.
References llvm::make_range(), set_bits_begin(), and set_bits_end().
Referenced by llvm::DependenceInfo::depends(), dumpSmallBitVector(), getConstantPart(), llvm::DependenceInfo::getSplitIteration(), and mayUsePostIncMode().
|
inline |
Definition at line 173 of file SmallBitVector.h.
Referenced by set_bits().
|
inline |
Definition at line 177 of file SmallBitVector.h.
Referenced by set_bits().
Add '1' bits from Mask to this vector.
Don't resize. This computes "*this |= Mask".
Definition at line 632 of file SmallBitVector.h.
References isSmall(), and llvm::BitmaskEnumDetail::Mask().
|
inline |
Add a bit to this vector for every '0' bit in Mask.
Don't resize. This computes "*this |= ~Mask".
Definition at line 650 of file SmallBitVector.h.
References isSmall(), and llvm::BitmaskEnumDetail::Mask().
|
inline |
Returns the number of bits in this bitvector.
Definition at line 193 of file SmallBitVector.h.
References isSmall().
Referenced by llvm::StatepointLoweringState::allocateStackSlot(), anyCommon(), llvm::StatepointLoweringState::isStackSlotAllocated(), operator &=(), operator==(), operator[](), operator^=(), operator|=(), push_back(), llvm::StatepointLoweringState::reserveStackSlot(), reset(), set(), and test().
|
inline |
Definition at line 626 of file SmallBitVector.h.
References std::swap().
Referenced by operator=(), and std::swap().
Definition at line 464 of file SmallBitVector.h.
Referenced by llvm::DwarfExpression::addMachineReg(), llvm::StatepointLoweringState::allocateStackSlot(), anyCommon(), llvm::StatepointLoweringState::isStackSlotAllocated(), operator &=(), operator^=(), operator|=(), llvm::StatepointLoweringState::reserveStackSlot(), reset(), and test().
|
inline |