12 #ifndef LLVM_FUZZER_VALUE_BIT_MAP_H
13 #define LLVM_FUZZER_VALUE_BIT_MAP_H
28 void Reset() { memset(Map, 0,
sizeof(Map)); }
36 uintptr_t Old = Map[WordIdx];
37 uintptr_t New = Old | (1UL << BitIdx);
42 inline bool Get(uintptr_t Idx) {
46 return Map[WordIdx] & (1UL << BitIdx);
56 size_t OldNumBits = NumBits;
58 auto O = Other.Map[
i];
65 Res += __builtin_popcountl(M);
68 return OldNumBits < NumBits;
71 template <
class Callback>
74 if (uintptr_t M = Map[
i])
75 for (
size_t j = 0; j <
sizeof(M) * 8; j++)
76 if (M & ((uintptr_t)1 << j))
77 CB(i *
sizeof(M) * 8 + j);
87 #endif // LLVM_FUZZER_VALUE_BIT_MAP_H
void ForEach(Callback CB)
size_t GetNumBitsSinceLastMerge() const
bool AddValue(uintptr_t Value)
static const size_t kNumberOfItems
static const size_t kMapSizeInWords
static const size_t kBitsInWord
static const size_t kMapSizeInBits
#define ATTRIBUTE_TARGET_POPCNT
static const size_t kMapSizeInBitsAligned
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
ATTRIBUTE_TARGET_POPCNT bool MergeFrom(ValueBitMap &Other)