When clearing a SmallPtrSet, if the set had a huge capacity, but the
authorChris Lattner <sabre@nondot.org>
Sun, 5 Aug 2007 07:32:14 +0000 (07:32 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 5 Aug 2007 07:32:14 +0000 (07:32 +0000)
commit42e4bdf2577946380ce1529d5716e48b33d4186d
tree3a77344832b30c3317ca27bc483ca7690d4e7dc8
parenta31965301da89a7d0c829bded72c6b0da0303c54
When clearing a SmallPtrSet, if the set had a huge capacity, but the
contents of the set were small, deallocate and shrink the set.  This
avoids having us to memset as much data, significantly speeding up
some pathological cases.  For example, this speeds up the verifier
from 0.3899s to 0.0763 (5.1x) on the testcase from PR1432 in a
release build.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40837 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ADT/DenseMap.h
include/llvm/ADT/SmallPtrSet.h
lib/Support/SmallPtrSet.cpp