[llvm-commits] Review request: dominance frontier computation speedup

Jakob Stoklund Olesen stoklund at 2pi.dk
Wed Nov 24 09:44:50 PST 2010


On Nov 23, 2010, at 11:34 PM, Cameron Zwarich wrote:

> On 2010-11-23, at 11:16 PM, Jakob Stoklund Olesen wrote:
> 
>> On Nov 23, 2010, at 9:27 PM, Cameron Zwarich wrote:
>> 
>>> There aren't very many good use cases for std::set. Most dominance frontiers are small, so a SmallPtrSet seemed like a good choice. I experimented with different small values of the inline capacity and found that 2 was best for performance.
>> 
>> Does the majority of sets really have only 2 or less members? Otherwise, a DenseSet might be better.
> 
> I didn't take any stats, but on the same benchmark using DenseSet is more than 2x slower.

Probably because each set mallocs.

On second thought, I am not so sure it is a good idea to replace std::set here. The dominance frontier data structure has quadratic size, and this change could blow up the constant factor.

When a SmallPtrSet overflows its 'small' size, it allocates space for 128 pointers. That uses more memory than a std::set for up to 32 entries which is probably most cases.

Actually, I think Chris wants to get rid of dominance frontiers entirely because of the memory requirements.

/jakob

-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1929 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20101124/bcc0be43/attachment.bin>


More information about the llvm-commits mailing list