<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Apr 27, 2017 at 11:56 AM, Rafael Espíndola <span dir="ltr"><<a href="mailto:rafael.espindola@gmail.com" target="_blank">rafael.espindola@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">> Right, although I'd expect that taking the address in llvm.compiler.used<br>
> would have already prevented those sorts of optimizations.<br>
><br>
> The other thing is that we may be using linkage in the midend as an<br>
> optimization hint (for example, we may use a higher inlining threshold for<br>
> functions with internal linkage). But I'd expect those kinds of hints to<br>
> only apply to functions whose address is not taken (i.e. by<br>
> llvm.compiler.used). So we should be in the same position as before.<br>
<br>
</span>True, so it was really just saving a symbol from the symbol table.<br>
That helps the dynamic linker a bit, but it is hard to imagine a case<br>
with so many of these that it would make a difference.<br></blockquote><div><br></div><div>If a symbol needs to be added to the dynamic symbol table, I would expect it to be marked as used by the linker (i.e. VisibleToRegularObj), and in fact that is what lld does. That would mean that it could not have been internalized before. So I think it actually makes no difference (except perhaps to the static symbol table, but that isn't important).</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
Was this the last use of llvm.compiler_used?<br></blockquote><div><br></div><div>The correct spelling is "llvm.compiler.used", and it looks like we are still using it in a few places (including the legacy LTO API).</div><div><a href="http://llvm-cs.pcc.me.uk/?q=%22llvm%5C.compiler%5C.used%22">http://llvm-cs.pcc.me.uk/?q=%22llvm%5C.compiler%5C.used%22</a></div><div><br></div><div>Thanks,</div></div>-- <br><div class="gmail_signature"><div dir="ltr">-- <div>Peter</div></div></div>
</div></div>