[PATCH] D91467: ADT: Take small enough, trivially copyable T by value in SmallVector (otherwise, assert)

Duncan P. N. Exon Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Nov 17 13:42:58 PST 2020


dexonsmith updated this revision to Diff 305896.
dexonsmith retitled this revision from "ADT: Take small enough, trivially copyable T by value in SmallVector" to "ADT: Take small enough, trivially copyable T by value in SmallVector (otherwise, assert)".
dexonsmith edited the summary of this revision.
dexonsmith added a comment.

Updates:

- Switched size limit to `2 * sizeof(void *)`.
- Rebased on top of 2c196bbc6bd897b3dcc1d87a3baac28e1e88df41 <https://reviews.llvm.org/rG2c196bbc6bd897b3dcc1d87a3baac28e1e88df41>.
- Added assertions catching invalidation when the by-value optimization doesn't kick in.
- Added tests.

Note that the new assertions caught a bug in llvm/utils/TableGen/CodeGenSchedule.cpp and I found another related one by chance (not caught by these assertions though, since `emplace_back` is opaque). I'm still building, so once the tests run I assume there will be a number of other failures.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D91467/new/

https://reviews.llvm.org/D91467

Files:
  llvm/include/llvm/ADT/SmallVector.h
  llvm/unittests/ADT/SmallVectorTest.cpp
  llvm/utils/TableGen/CodeGenSchedule.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D91467.305896.patch
Type: text/x-patch
Size: 14280 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20201117/a42799d3/attachment.bin>


More information about the llvm-commits mailing list