[llvm-commits] [PATCH] SmallVector specialization

Peter Cooper peter_cooper at apple.com
Wed Feb 15 20:18:44 PST 2012


Hi all

Please review this patch to specialize SmallVector::push_back based on whether the type is POD.  Basically i'm avoiding the call to placement new which was creating null checks on the pointer.  As we know the pointer is never null here this should be safe.

Removal of these null checks allows far more optimization in the common case where we constructed a SmallVector then immediately pushed back into it.  The clang executable on x86_64 darwin Release+Asserts goes from 35373352 to 35181016 bytes, a reduction of 188KB.

Thanks,
Pete
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smallvec.patch
Type: application/octet-stream
Size: 2096 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120215/c0b161f4/attachment.obj>


More information about the llvm-commits mailing list