[llvm] [WIP][ADT] Avoid slow size queries on append (PR #136365)

Jakub Kuderski via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 18 13:46:01 PDT 2025


================
@@ -887,8 +921,8 @@ class SmallVectorImpl : public SmallVectorTemplateBase<T> {
     this->assertSafeToAddRange(From, To);
 
     size_t NumToInsert = std::distance(From, To);
----------------
kuhar wrote:

This is only invoked when we insert in the middle of the vector -- I'm not sure how much we care about this. We could potentially first append and then when we know size do a rotate, but I'm not sure it's worth it

https://github.com/llvm/llvm-project/pull/136365


More information about the llvm-commits mailing list