Hi, It is not clear to me in the clang LTO documentation. Can the optimization across multiple functions? For example, if a function turns better to be inlined, will it be inlined? Or if some basicblocks are the same between functions, will multiple functions use the same basic block. Thanks. https://clang.llvm.org/docs/ThinLTO.html -- Regards, Peng
Teresa Johnson via llvm-dev
2019-Feb-16 22:40 UTC
[llvm-dev] Can LTO optimize across functions?
ThinLTO (as well as regular aka "full" LTO) essentially expand the scope of the optimizer through link time optimization techniques. So interprocedural optimizations (IPO) such as inlining functions into callsites which without LTO would be restricted to the Module (or Translation Unit) scope, now can be performed across code that was from different Translation Units (originally different Modules). LTO also enables some more aggressive whole program optimizations that aren't available without whole program scope (e.g. whole program dead stripping, internalization, etc). Hope that helps. Teresa On Sat, Feb 16, 2019 at 10:43 AM Peng Yu via llvm-dev <llvm-dev at lists.llvm.org> wrote:> > Hi, > > It is not clear to me in the clang LTO documentation. Can the > optimization across multiple functions? For example, if a function > turns better to be inlined, will it be inlined? Or if some basicblocks > are the same between functions, will multiple functions use the same > basic block. Thanks. > > https://clang.llvm.org/docs/ThinLTO.html > > -- > Regards, > Peng > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev-- Teresa Johnson | Software Engineer | tejohnson at google.com |