<div dir="ltr"><br><br><div class="gmail_quote"><div dir="ltr">On Tue, Jun 30, 2015 at 10:54 PM Duncan Exon Smith <<a href="mailto:dexonsmith@apple.com">dexonsmith@apple.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>I agree it's probably worth formalizing a smaller vector type, but nothing specifically in mind -- I just noticed when looking at the struct layout of MCRelaxableFragment with Pete that the SmallVector<MCFixup,1> was 56 bytes instead of the 48 bytes I thought it would be.</div><div><br></div><div>(BTW, it's crazy that every relaxable fragment carries around a full copy of the MCSubtargetInfo.  Until today I thought that was a reference!)</div><div><br>-- dpn</div></div></blockquote><div><br></div><div>Gack. That's pretty painful. Perhaps changing it to a reference to a unique STI that's kept on the side somewhere in a map? Or something...</div><div><br></div><div>-eric</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div>es</div></div><div dir="auto"><div><br>On Jun 30, 2015, at 8:52 PM, Sean Silva <<a href="mailto:chisophugis@gmail.com" target="_blank">chisophugis@gmail.com</a>> wrote:<br><br></div><blockquote type="cite"><div><div dir="ltr"><div>Is there a specific place where we're storing SmallVectors in a datastructure that you're trying to optimize with this? It might be worth investing in a more general small-sizeof vector than TinyPtrVector. The way the SmallVector currently works (such as actually containing a 3 pointer "vector header") imposes some fundamental limitations on its sizeof.</div><div><br></div><div>There are various standard ways to greatly reduce sizeof of vectors especially in 64-bit address spaces (and certain assumptions on the OS...) where often the high bits are redundant, allowing the vector header to be compressed to a single pointer in size across a very large size range. Even without the spacious high-bits of a 64-bit address space, we can often store at least up to size 4 or 8 in the low bits, which for many use cases is plenty in the common case.</div><div><div><br></div><div>(to be clear, I think this patch makes sense; just had a high-level question)<br><div><br></div><div>-- Sean Silva<br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 30, 2015 at 5:34 PM, Duncan P. N. Exon Smith <span dir="ltr"><<a href="mailto:dexonsmith@apple.com" target="_blank">dexonsmith@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">I'd just commit this, but I want to check:<br>
<br>
 1. Are my static asserts valid under MSVC?  Sanitizers?  If not, what<br>
    *is* a portable way to check that we don't waste memory here?<br>
 2. I like them in SmallVector.h (assuming they're portable).<br>
    Anyone strongly prefer ADTTests?<br>
<br>
Avoid an unused byte -- which for `sizeof(T) >= sizeof(void *)` costs<br>
a pointer -- on `SmallVector<T, 1>`.  Shave the same byte off of<br>
`SmallVector<T, 0>`.  Otherwise, no functionality change.<br>
<br>
Note that `SmallVector<T, 0>` has the same memory footprint as<br>
`SmallVector<T, 1>`, which seems like a bug to me.  We should probably<br>
fix that too.<br>
<br>
<br>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
<br></blockquote></div><br></div></div></div></div></div>
</div></blockquote></div>_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu" target="_blank">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div></div>