[PATCH] LLD: Use std::vector to store SimpleReferences instead of linked list.

Rui Ueyama ruiu at google.com
Sun Mar 15 23:07:51 PDT 2015


I think SmallVector guarantees the array it contains is contiguous in
memory. That data structure does not work well with BumpPtrAllocator
because garbage after extending the array is not reclaimed until the whole
buffer is discarded. That makes memory consumption of a small vector from
O(n) to O(n^2).

That being said, that behavior might be acceptable if we rarely extend
SmallVectors. So, maybe it's not a bad idea, but I don't know if it's good
enough to add an additional parameter to SmallVector's constructor.

On Sun, Mar 15, 2015 at 10:49 PM, Yaron Keren <yaron.keren at gmail.com> wrote:

> This may mean we need teach SmallVector to accept allocator like other ADT.
>
>
> http://reviews.llvm.org/D8182
>
> EMAIL PREFERENCES
>   http://reviews.llvm.org/settings/panel/emailpreferences/
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150315/7714f30f/attachment.html>


More information about the llvm-commits mailing list