[llvm-commits] Patch: SparseMultiSet

Michael Ilseman milseman at apple.com
Wed Jan 16 10:39:30 PST 2013


Attached is a patch introducing a new data structure, the SparseMultiSet, and changes to the MI scheduler to use it.

A SparseMultiSet adds multiset behavior to SparseSet, while retaining SparseSet's desirable properties. Essentially, SparseMultiSet provides multiset behavior by storing its dense data in doubly linked lists that are inlined into the dense vector. This allows it to provide good data locality as well as vector-like constant-time clear() and fast constant time find(), insert(), and erase(). It also allows SparseMultiSet to have a builtin recycler rather than keeping SparseSet's behavior of always swapping upon removal, which allows it to preserve more iterators. It's often a better alternative to a SparseSet of a growable container or vector-of-vector.

Unit tests included in patch.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sparseMultiSet.patch
Type: application/octet-stream
Size: 32952 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130116/afd8799d/attachment.obj>


More information about the llvm-commits mailing list