[PATCH] Add find_as to DenseSet.

Chandler Carruth chandlerc at google.com
Sun Oct 19 12:11:33 PDT 2014


This looks fine.

I'll also note that if you have heavy usage of DenseSet, it could be made
quite a bit more cache friendly than it is by not implementing it in terms
of DenseMap.

On Sun, Oct 19, 2014 at 11:56 AM, Lang Hames <lhames at gmail.com> wrote:

> In case the concrete use-case is of interest: I want to switch PBQP's
> pooling CostAllocator from a std::set to a DenseSet*. PBQP::MDMatrices (the
> pool values) are more than twice as expensive to construct as the key
> values (PBPQ::Matrix).
>
> Cheers,
> Lang.
>
> * This change is good for a ~4% reduction in total compile time on the
> nightly test suite when using -regalloc=pbqp.
>
>
> On Sun, Oct 19, 2014 at 11:51 AM, Lang Hames <lhames at gmail.com> wrote:
>
>> Hi All,
>>
>> This patch adds the find_as operation to DenseSet.
>>
>> As with the corresponding method in DenseMap, this is useful if you have
>> a DenseSet that contains expensive-to-contruct values, but there exists
>> some cheap-to-construct type that can be used as a key for lookup.
>>
>> Unit-test included.
>>
>> Cheers,
>> Lang.
>>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141019/40bd270b/attachment.html>


More information about the llvm-commits mailing list