<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Aug 8, 2016 at 9:32 AM, David Blaikie via cfe-commits <span dir="ltr"><<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr">I'm still (as per another similar thread) a bit concerned this is working around a compiler optimizer bug - I'd love to see a standalone example of this behavior (that adding the inline keyword to an already inline/available definition is what's causing the inlining) so we can look at what the compiler might be doing wrong (& consider fixing that as the root cause instead of having to change every instance of this problem) - preferably an example without std::string/headers/etc (so, preprocessed and reduced).<br></div></blockquote><div><br></div><div>Normally I would agree that this is an optimizer bug, but std::string is externally instantiated.</div><div>It seems reasonable for Clang *not* to inline externally instantiated templates unless requested.</div><div>Simply removing the extern template declaration will resolve these inlining issues.</div><div><br></div><div>Here is the standalone example you requested: <a href="https://godbolt.org/g/aVwEMR">https://godbolt.org/g/aVwEMR</a></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br>But up to you folks maintaining libc++ whether this goes in of course, just my 2c.</div><br><div class="gmail_quote"><div><div class="h5"><div dir="ltr">On Wed, Aug 3, 2016 at 5:23 AM Aditya Kumar via cfe-commits <<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a>> wrote:<br></div></div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-style:solid;border-left-color:rgb(204,204,204);padding-left:1ex"><div><div class="h5">hiraditya added a comment.<br>
<br>
In <a href="https://reviews.llvm.org/D22782#504416" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D22782#504416</a>, @EricWF wrote:<br>
<br>
> The change itself LGTM, although we probably want to inline the forward/input iterator __init's as well.<br>
><br>
> However I would like to see a small benchmark that demonstrates the performance change. Please try and write the benchmark using Google Benchmark.<br>
>  Some helpful links:<br>
><br>
> - <a href="http://libcxx.llvm.org/docs/TestingLibcxx.html#building-benchmarks" rel="noreferrer" target="_blank">http://libcxx.llvm.org/docs/<wbr>TestingLibcxx.html#building-<wbr>benchmarks</a><br>
> - <a href="http://github.com/google/benchmark" rel="noreferrer" target="_blank">http://github.com/google/<wbr>benchmark</a><br>
<br>
<br>
Sure,<br>
We'll come up with a synthetic benchmark to expose performance improvements.<br>
<br>
Thanks,<br>
<br>
<br>
<a href="https://reviews.llvm.org/D22782" rel="noreferrer" target="_blank">https://reviews.llvm.org/<wbr>D22782</a><br>
<br>
<br>
<br></div></div><span class="">
______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org" target="_blank">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
</span></blockquote></div>
<br>______________________________<wbr>_________________<br>
cfe-commits mailing list<br>
<a href="mailto:cfe-commits@lists.llvm.org">cfe-commits@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-commits</a><br>
<br></blockquote></div><br></div></div>