<div dir="ltr">Very few, if any, optimizations are done by Clang - where possible Clang augments the LLVM IR with extra information to enable LLVM to perform the optimizations.<br><br>Clang's IR generation does vary depending on optimization level - but usually on in this sort of attribute-application context. (eg: applying the 'inlinehint' attribute above -O0, applying the 'optnone' attribute at -O0, etc).<br><br>Maybe some of the memcpy optimization (turning struct copying into memcpies) is done in the frontend - because it knows it can copy around the padding bytes if that's more convenient.<br><br>Even very C++-y things like devirtualization are still, ideally, implemented in LLVM - trying to provide as general a tool as possible for frontends to express these kinds of constraints to the LLVM optimization pipeline.<br><br>- Dave</div><br><div class="gmail_quote"><div dir="ltr">On Mon, Oct 29, 2018 at 4:21 AM Alexander Zaitsev via cfe-dev <<a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hello.<br>
<br>
I am trying to find in Clang sources which kind of optimizations do<br>
directly Clang, not LLVM. What I want to do - I have some ideas for<br>
optimization which can be done only for C++ code. And as I understand<br>
Clang is the right place for doing this but I cannot find any example.<br>
<br>
Can you help me a little bit and provide any existent example in Clang<br>
sources?<br>
<br>
Thank you.<br>
<br>
-- <br>
Best regards,<br>
Alexander Zaitsev<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev</a><br>
</blockquote></div>