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

Cameron Zwarich zwarich at apple.com
Tue Nov 23 23:34:13 PST 2010


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.

>> This is an 18% speedup running domfrontier on test-suite + SPEC2000.
>> 
>> <domfrontier-set.patch>
> 
> Looks good to me. Are you going to replace std::map with DenseMap as well?

I was considering it, but I wasn't sure about the memory footprint of a DenseMap with SmallPtrSet elements. I guess they could all be allocated with a PtrBumpAllocator if it is a performance issue, but it is still wasted memory.

Cameron



More information about the llvm-commits mailing list