[cfe-dev] Which optimizations are done by Clang, not LLVM
David Blaikie via cfe-dev
cfe-dev at lists.llvm.org
Mon Oct 29 08:00:09 PDT 2018
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
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,
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.
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
On Mon, Oct 29, 2018 at 4:21 AM Alexander Zaitsev via cfe-dev <
cfe-dev at lists.llvm.org> wrote:
> I am trying to find in Clang sources which kind of optimizations do
> directly Clang, not LLVM. What I want to do - I have some ideas for
> optimization which can be done only for C++ code. And as I understand
> Clang is the right place for doing this but I cannot find any example.
> Can you help me a little bit and provide any existent example in Clang
> Thank you.
> Best regards,
> Alexander Zaitsev
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev