[PATCH] D74984: [ADT] Add CoalescingBitVector, implemented using IntervalMap [1/3]

Vedant Kumar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 21 12:17:53 PST 2020


vsk created this revision.
Herald added subscribers: llvm-commits, dexonsmith, mgorny.
Herald added a project: LLVM.
vsk added reviewers: aprantl, jmorse.
vsk added a project: debug-info.

Add CoalescingBitVector to ADT. This is part 1 of a 3-part series to
address a compile-time explosion issue in LiveDebugValues.

---

CoalescingBitVector is a bitvector that, under the hood, relies on an
IntervalMap to coalesce elements into intervals.

CoalescingBitVector efficiently represents sets which predominantly
contain contiguous ranges (e.g.  the VarLocSets in LiveDebugValues,
which are very long sequences that look like {1, 2, 3, ...}). OTOH,
CoalescingBitVector isn't good at representing sets with lots of gaps
between elements. The first N coalesced intervals of set bits are stored
in-place (in the initial heap allocation).

Compared to SparseBitVector, CoalescingBitVector offers more predictable
performance for non-sequential find() operations. This provides a
crucial speedup in LiveDebugValues.


https://reviews.llvm.org/D74984

Files:
  llvm/include/llvm/ADT/CoalescingBitVector.h
  llvm/unittests/ADT/CMakeLists.txt
  llvm/unittests/ADT/CoalescingBitVectorTest.cpp
  llvm/unittests/ADT/IntervalMapTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D74984.245956.patch
Type: text/x-patch
Size: 24803 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200221/09b4e8ea/attachment.bin>


More information about the llvm-commits mailing list