[PATCH] D16672: SmallPtrSet: Avoid initializing Array in the small case.

Matthias Braun via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 27 22:08:42 PST 2016


MatzeB created this revision.
MatzeB added reviewers: dblaikie, chandlerc, reames, bkramer, hfinkel.
MatzeB added a subscriber: llvm-commits.
MatzeB set the repository for this revision to rL LLVM.
Herald added a subscriber: mcrosier.

This patch avoids the initial memset at the cost of making iterators
slightly more complex. This should be beneficial as most SmallPtrSets
hold no or only a few elements, while iterating over them is less
common.

It's not a measurable change in compiletime but valgrind/callgrind shows saving of ~0.25% instructions in my tests.

Repository:
  rL LLVM

http://reviews.llvm.org/D16672

Files:
  include/llvm/ADT/SmallPtrSet.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D16672.46222.patch
Type: text/x-patch
Size: 4484 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160128/9710623b/attachment.bin>


More information about the llvm-commits mailing list