[llvm-commits] [PATCH] Make Inits FoldingSetNodes

David A. Greene greened at obbligato.org
Fri Jul 15 09:13:17 PDT 2011


Chris Lattner <clattner at apple.com> writes:

>> Question on these three.  DenseMap of what?  There's an opcode, multiple
>> operands and a type.  What's the Key, a struct of these items?  Is a
>> DenseMap much more efficient than a FoldingSetNode when string
>> comparison/hash is involved?  Wouldn't hashing a struct of these and
>> putting them in a DenseMap basically be equivalent to a FoldingSet?
>
> FoldingSet is only efficient for very large and heterogenous objects.
> Its constant factor is really very very high, so densemap is almost
> always a win for something with a few elements.

Ok, good to know.  Would you recommend creating some kind of hash of
these elements and using that to index a DenseMap?

                                 -Dave



More information about the llvm-commits mailing list