<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 28, 2016 at 2:34 PM, Piotr Padlewski <span dir="ltr"><<a href="mailto:piotr.padlewski@gmail.com" target="_blank">piotr.padlewski@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote"><span class="">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="m_2372037721002901132gmail-">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="m_2372037721002901132gmail-"><div> <br></div></span></div></div></div></blockquote></span><div>True, I gonna start thread about it soon. </div></div></div></div></blockquote><div><br></div><div>Can you please just revert this and discuss it, and then we decide what to do as a whole?<br>I'd rather not see it done piecemeal before we decide what to do :P<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span class=""><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="m_2372037721002901132gmail-"><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></span></div><br></div><div class="gmail_extra">Some numbers:</div><div class="gmail_extra"><a href="https://youtu.be/smqT9Io_bKo?t=29m16s" target="_blank">https://youtu.be/smqT9Io_bKo?<wbr>t=29m16s</a><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">It is for map insert/emplace.</div></div></blockquote><div><br></div><div>This is about whether the insertion happens or not.</div><div>That seems very different than the other cases.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"> 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></blockquote><div><br></div><div>We also probably, IMHO, do not want to litter the code with both push_back *and* emplace_back if there is no performance loss from emplace_back except for maps/sets.</div><div><br></div><div>The whole point of code style is consistency, with exceptions made for performance, etc.</div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><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" target="_blank">http://clang.llvm.org/extra/<wbr>clang-tidy/checks/modernize-<wbr>use-emplace.html</a><span class="HOEnZb"><font color="#888888"><br></font></span></div><span class="HOEnZb"><font color="#888888"><div class="gmail_extra"><br></div><div class="gmail_extra">Piotr</div></font></span></div>
</blockquote></div><br></div></div>