<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">2016-12-28 22:09 GMT+01:00 Daniel Berlin <span dir="ltr"><<a href="mailto:dberlin@dberlin.org" target="_blank">dberlin@dberlin.org</a>></span>:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote"><span class="gmail-">On Wed, Dec 28, 2016 at 12:36 PM, Piotr Padlewski via llvm-commits <span dir="ltr"><<a href="mailto:llvm-commits@lists.llvm.org" target="_blank">llvm-commits@lists.llvm.org</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">Author: prazek<br>
Date: Wed Dec 28 14:36:08 2016<br>
New Revision: 290685<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=290685&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-pr<wbr>oject?rev=290685&view=rev</a><br>
Log:<br>
[NewGVN] replace emplace_back with push_back<br></blockquote><div><br></div></span><div>I'm somewhat against this change.</div><div>It would be nice to have coding guidelines here.</div><span class="gmail-"><div> <br></div></span></div></div></div></blockquote><div>True, I gonna start thread about it soon. </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class="gmail-"><div></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
emplace_back is not faster if it is equivalent to push_back. In this cases emplaced value had the<br>
same type that the one stored in container. It is ugly and it might be even slower (see<br>
Scott Meyers presentation about emplacement).<br></blockquote><div><br></div></span><div>I'm going to disagree about "ugly", i don't think it's ugly or not ugly.</div><div>If it's really slower, i'd like to see numbers.<br></div><div>Otherwise, i think we should just be consistent if we can.</div><div><br></div></div></div></div>
</blockquote></div><br></div><div class="gmail_extra">Some numbers:</div><div class="gmail_extra"><a href="https://youtu.be/smqT9Io_bKo?t=29m16s">https://youtu.be/smqT9Io_bKo?t=29m16s</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">It is for map insert/emplace. It probably doesn't matter much for emplace_back, it only can add extra instantiations, </div><div class="gmail_extra">but I guess we don't want to have diffrent rules for using insert/emplace and push_back/emplace_back</div><div class="gmail_extra"><br></div><div class="gmail_extra">There is also some useful info here:</div><div class="gmail_extra"><a href="http://clang.llvm.org/extra/clang-tidy/checks/modernize-use-emplace.html">http://clang.llvm.org/extra/clang-tidy/checks/modernize-use-emplace.html</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">Piotr</div></div>