|
LLVM
4.0.0
|
This is a 'bitvector' (really, a variable-sized bit array), optimized for the case when the array is small. More...
#include <SmallBitVector.h>
Classes | |
| class | reference |
Public Types | |
| typedef unsigned | size_type |
Public Member Functions | |
| SmallBitVector () | |
| 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 () | |
| 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_next (unsigned Prev) const |
| Returns the index of the next set bit following the "Prev" bit. 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 |
| 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) |
| 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 28 of file SmallBitVector.h.
Definition at line 54 of file SmallBitVector.h.
|
inline |
Creates an empty bitvector.
Definition at line 140 of file SmallBitVector.h.
Referenced by operator~().
Creates a bitvector of specified number of bits.
All bits are initialized to the specified value.
Definition at line 144 of file SmallBitVector.h.
References t.
|
inline |
SmallBitVector copy ctor.
Definition at line 152 of file SmallBitVector.h.
|
inline |
Definition at line 159 of file SmallBitVector.h.
|
inline |
Definition at line 163 of file SmallBitVector.h.
|
inline |
Returns true if all bits are set.
Definition at line 195 of file SmallBitVector.h.
References llvm::BitVector::all().
Referenced by lowerVectorShuffle(), and lowerVectorShuffleWithSSE4A().
|
inline |
Returns true if any bit is set.
Definition at line 188 of file SmallBitVector.h.
References llvm::BitVector::any().
Referenced by llvm::DwarfExpression::AddMachineReg(), llvm::DependenceInfo::depends(), llvm::DependenceInfo::getSplitIteration(), and matchBinaryPermuteVectorShuffle().
|
inline |
Test if any common bits are set.
Definition at line 380 of file SmallBitVector.h.
References llvm::BitVector::anyCommon(), i, fuzzer::min(), size(), and test().
|
inline |
Clear all bits.
Definition at line 234 of file SmallBitVector.h.
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 523 of file SmallBitVector.h.
References llvm::BitVector::clearBitsInMask(), 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 541 of file SmallBitVector.h.
References llvm::BitVector::clearBitsNotInMask(), and llvm::BitmaskEnumDetail::Mask().
|
inline |
Returns the number of bits which are set.
Definition at line 179 of file SmallBitVector.h.
References llvm::tgtok::Bits, llvm::BitVector::count(), and llvm::countPopulation().
Referenced by llvm::DependenceInfo::depends(), EltsFromConsecutiveLoads(), llvm::DependenceInfo::getSplitIteration(), and lowerVectorShuffleAsSplitOrBlend().
|
inline |
Tests whether there are no bits in this bitvector.
Definition at line 169 of file SmallBitVector.h.
References llvm::BitVector::empty().
Referenced by getTargetConstantBitsFromNode().
|
inline |
Returns the index of the first set bit, -1 if none of the bits are set.
Definition at line 209 of file SmallBitVector.h.
References llvm::tgtok::Bits, llvm::countTrailingZeros(), and llvm::BitVector::find_first().
Referenced by llvm::DependenceInfo::depends(), dumpSmallBitVector(), EltsFromConsecutiveLoads(), and llvm::DependenceInfo::getSplitIteration().
|
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 221 of file SmallBitVector.h.
References llvm::tgtok::Bits, llvm::countTrailingZeros(), and llvm::BitVector::find_next().
Referenced by llvm::DependenceInfo::depends(), dumpSmallBitVector(), and llvm::DependenceInfo::getSplitIteration().
|
inline |
Definition at line 341 of file SmallBitVector.h.
References llvm::BitVector::flip().
|
inline |
Definition at line 349 of file SmallBitVector.h.
References llvm::BitVector::flip().
|
inline |
Returns true if none of the bits are set.
Definition at line 202 of file SmallBitVector.h.
References llvm::BitVector::none().
|
inline |
Definition at line 402 of file SmallBitVector.h.
|
inline |
Definition at line 407 of file SmallBitVector.h.
|
inline |
Definition at line 483 of file SmallBitVector.h.
|
inline |
Definition at line 500 of file SmallBitVector.h.
|
inline |
Definition at line 393 of file SmallBitVector.h.
References size().
Definition at line 363 of file SmallBitVector.h.
Definition at line 368 of file SmallBitVector.h.
|
inline |
Definition at line 468 of file SmallBitVector.h.
|
inline |
Definition at line 454 of file SmallBitVector.h.
|
inline |
Definition at line 358 of file SmallBitVector.h.
References SmallBitVector().
|
inline |
Definition at line 257 of file SmallBitVector.h.
References i, llvm::BitVector::reserve(), and llvm::BitVector::set().
|
inline |
Definition at line 310 of file SmallBitVector.h.
References llvm::BitVector::reset().
Referenced by llvm::DependenceInfo::depends(), llvm::DependenceInfo::getSplitIteration(), llvm::SmallBitVector::reference::operator=(), reset(), and simplifyShuffleOperandRecursively().
|
inline |
Definition at line 318 of file SmallBitVector.h.
References llvm::BitVector::reset().
|
inline |
Efficiently reset a range of bits in [I, E)
Definition at line 327 of file SmallBitVector.h.
References assert(), E, I, llvm::BitmaskEnumDetail::Mask(), llvm::BitVector::reset(), and size().
|
inline |
Reset bits that are set in RHS. Same as *this &= ~RHS.
Definition at line 422 of file SmallBitVector.h.
References i, fuzzer::min(), llvm::BitVector::reset(), reset(), size(), and test().
Grow or shrink the bitvector.
Definition at line 241 of file SmallBitVector.h.
References i, llvm::BitVector::resize(), and t.
Referenced by llvm::StatepointLoweringState::allocateStackSlot(), lowerVectorShuffleAsSplitOrBlend(), operator&=(), operator^=(), operator|=(), and llvm::StatepointLoweringState::startNewStatepoint().
|
inline |
Definition at line 275 of file SmallBitVector.h.
References llvm::BitVector::set().
Referenced by llvm::DwarfExpression::AddMachineReg(), llvm::StatepointLoweringState::allocateStackSlot(), llvm::DependenceInfo::depends(), llvm::LegalizerInfo::getAction(), llvm::DependenceInfo::getSplitIteration(), getTypeToPrint(), llvm::SmallBitVector::reference::operator=(), and llvm::StatepointLoweringState::reserveStackSlot().
|
inline |
Definition at line 283 of file SmallBitVector.h.
References assert(), and llvm::BitVector::set().
|
inline |
Efficiently set a range of bits in [I, E)
Definition at line 296 of file SmallBitVector.h.
References assert(), E, I, llvm::BitmaskEnumDetail::Mask(), llvm::BitVector::set(), and size().
Add '1' bits from Mask to this vector.
Don't resize. This computes "*this |= Mask".
Definition at line 514 of file SmallBitVector.h.
References llvm::BitmaskEnumDetail::Mask(), and llvm::BitVector::setBitsInMask().
|
inline |
Add a bit to this vector for every '0' bit in Mask.
Don't resize. This computes "*this |= ~Mask".
Definition at line 532 of file SmallBitVector.h.
References llvm::BitmaskEnumDetail::Mask(), and llvm::BitVector::setBitsNotInMask().
|
inline |
Returns the number of bits in this bitvector.
Definition at line 174 of file SmallBitVector.h.
References llvm::BitVector::size().
Referenced by llvm::StatepointLoweringState::allocateStackSlot(), anyCommon(), convertBitVectorToUnsiged(), getConstVector(), isNonZeroElementsInOrder(), llvm::StatepointLoweringState::isStackSlotAllocated(), operator&=(), operator==(), operator[](), operator^=(), operator|=(), llvm::StatepointLoweringState::reserveStackSlot(), reset(), set(), and test().
|
inline |
Definition at line 508 of file SmallBitVector.h.
References std::swap().
Referenced by operator=(), and std::swap().
Definition at line 375 of file SmallBitVector.h.
Referenced by llvm::StatepointLoweringState::allocateStackSlot(), anyCommon(), llvm::StatepointLoweringState::isStackSlotAllocated(), llvm::StatepointLoweringState::reserveStackSlot(), reset(), and test().
|
inline |
Check if (This - RHS) is zero. This is the same as reset(RHS) and any().
Definition at line 436 of file SmallBitVector.h.
References i, fuzzer::min(), size(), llvm::BitVector::test(), and test().
1.8.6